Added a gameLogic class to remove the game logic from main.js.