General refactoring
Initial step in implementing toggle button
improved shortcut key handling and key parsing