Phase Shifts, Herbivory, and the Resilience of Coral Reefs to Climate Change