Split context into context and state.