Refactored Game JS model and added tests