Fixed some bad coding practices

Game.quit() now sets a flag that gets checked in main instead of using
System.exit. ParseInputAndExecute has been split into two functions to
ease testing.