Reset undo manager when new document opened

Otherwise previous document undo/redo's will apply to the new document.