Some cleanup in preparation for restructuring the undo/redo system.