What are two main factors that made the Catholic Church the most powerful institution in western Europe during the Middle Ages?