Change event handler registration

Change event handler registration to addEventListener instead of using deprecated overriding of onKeydown, etc. This also fixes the issues where the app was not getting keypress callbacks.
Merge pull request #265 from sirako/master

Change event handler registration