Add input event DAG

This PR adds code for hotkey recognition and event emission.
Still WIP, but you can review the code that is present now.
Targets #321.
That's an B-Tree, isn't it? I suggest some short investigation on this, would cause this explanation to shorten a bit!