Move context menu related code into ContextMenu.cpp