Phase shifts and stable states on coral reefs