Make dynamic menus from common functions.

This is my best guess for what we need. May need updating later when we are combining more with ckan or Tom is updating the markup.