Major rewrite of menu structure to allow flexibility in nesting menus.