Move the function that finds an existing nav item by url in the navigation
BAO since it's a good utility function for navigation code.

Also, move refactor the code that handles all the reports menu item creation
and updating into a separate function outside run() to make it easier to
write a test for it, since now we don't have to deal with clearing the menu
cache and redirect.