Reusable feature for making CMS buttons that respond to the current
contextual state with an appearance change.
Provides capability to specify initial state, alternate icon and
alternate text via data attributes or options (PHP or JS), and to hook
up into events triggered when the state is alternating.
This is used by the follow-up cms action buttons cleanup work.