Distributed initial game logic to separate JS files

Distributed initial game logic to separate JS files and improved code
readability