Finally got turn-based logic to work by moving most of the setInterval
loops into the global scope. Instead of running setInterval from inside
an object and trying to manipulate an object's state variables that way,
I am running setInterval from outside the game object, and manipulating
its state variables (e.g., game.turn) from outside.
Some state variables still are manipulated from inside (e.g. game.done).
Next step: custom events to be fired by Ajax.done to replace state variables.