Refactoring game.js to use contstructor and prototype for defining the game