solved delete all elements undo bug.
solved redo bug.
refactored.
solved minor bug on undo batch remove element command.