fixes #456 - sort menus by hierarchy and menu options