Almost done.

Need to finish finalize() and also get new-game working (should be
pretty easy).
Merge branch 'master' into gh-pages