reorg and fix json serialization <-> gamestate