PersistentState interface and default in-memory implementation