Moved join game logic to game.model.js for unittesting