Add undo/redo implementation