Allow remap of 'q' button, don't clobber 'q' remap

The macro recording code couldn't differentiate between a single 'q'
being pressed or 'qq' (or rather, it always needed two keys to toggle).

To work around this problem the code would register a mapping for 'q' so
that pressing it the second time would actually result in two
keystrokes.

If the user remaps something to 'q', this mapping would get clobbered.
If on the other hand someone remapped another key to 'q', the workaround
mapping would not be triggered and another keypress was needed.

Implementing the whole as a custom state sidesteps the issue, as a
single keypress of 'q' can be differentiated from 'q' + macro name.

Fixes #495.