Centralize context menus and the undo manager.