"state is just a class" brings up so many questions though. How do you serialize state if it is "just a class"? Serializing the state is useful for all sorts of things, including debugging, reloading, and saving and loading application state.
Serializing state together with some code that operates on it may be doable but sounds either complicated or brittle.