Description
Before attempting OAK-659 again, I'd like to refactor KernelNodeStoreBranch since this one always makes me struggle with its convoluted state tracking and ad-hoc if/elsing. I'd like to transform the same logic into several inner classes representing the various states (i.e. state pattern) branch can be in (unmodified, in-memory, persisted and merged).