Refactoring game.js, passing jshint