Simplify our code with two separate stacks, one for undo and one for redo. No need to manage a dodgy index in a unified stack. We also ensure we add an implicit group for all calls made within a call to .undo() or .redo().