Basic serialization for persistent states implemented.