Add delegate to undo manager

@mczepiel