Improve debounce state machine.

Pressed and released bits were redundant.
Extract Key struct to own class.