Implements save and load for simulation state