refactored menu, added test and docs to mainnav