Add in more window event listeners

This will be useful later to do things such as:
* Pausing game while minimized
* Resuming game when restoring
Merge pull request #195 from dreamteam69/master

Add in more window event listeners