Refactored into a JS object and juggling scope all over.
Everything is broken.
Keyboard events working again.