Port all the game logic into JavaScript