During the middle ages, which religious organization wielded the most power in regions formerly under the rule of the roman empire?