add get_state interface (also added to V1.mli in mirage-types)