Fixed bug where pause after first game over didn't work

I accidentally bound one key-event for every time the game restarted, which resulted in a lot of key events.
Moved the key switch part to document-ready, to be run only once and allways checks if the game is started or not, which will decide what will happen with the key event.