Game.js refactor

Added lots of tests. Should probably merge this in after #25 

@flawedmatrix @strayhobo