Move read-write stuff from environment to a separate environment state.