Rewrite save/load state via JSON.
Remember to update GUI after state changed.