During which period in Egyptian history did the theocratic government began to decrease in power while the local leaders took control of their territories