markovgen serialization/deserialization