More progress on game logic.
Merge.