lib/game.js: refactor code and add dummy functions