Refactor core editor history stacks