Added menu for undo/redo

Also refactored instantiation of undo manager.