Do not list empty menus in application menu model

To prevent listing empty menus we iterate through the menu items of a menu first and look if there is at least one visible (sub-)menu or menu item. If we do not find any visible ones we do not process this menu and do not add it to list of menus so it will not show up.