Print "Game over." as soon as the game finishes.

Also make a few JavaScript style tweaks.