Implement game state cache.

Cache the last 10 game states calculated, not just the current state.