move game runner code out of cli.js