Refactoring into proper game and player js to clean up index