Add undo/redo functions for copy/paste/cut/delete