Implement undo/redo from the menu bar.