Make state machine data both reader and writer serialisable