Secular Variations in the Phanerozoic Reef Ecosystem