Initial work to add undo/redo functionality