Changed to coffeescript
Fully working coffeescript version
Extracted board object from game object