MDL-44092 Atto: Add selectionchanged event and listeners in the buttons.

This means the buttons can indicate the state of the text under the cursor.