Allow building main/sub menu and standalone menu

Include mainmenu as first option in pipe-separated list of groups
passed in group parameter