Add first draft of state recording in the framework