Add StateManager to abstract changes to bpmem.