Properly discard undos.

Also discard undos when user call discard method or the
next item is deleted in SINGLE_UNDO mode.
Fixed README