MDL-46652 custom_menu: fix for multi-language support breaks menu nesting

Fixed bug by building full menu structure, then removing hidden menu items and all associated children.
Refactored custom_menu_item class and convert_text_to_menu_nodes() to improve maintenance.
open in new tab for external links

Conflicts:
	lib/outputcomponents.php
force login for my page
instantiate custom_menu even if settings are empty
show custom menu items by capability permissions