Fix links from maps so they use the new url hrefs
Also remove some unneeded code and move the code that generates embedded javascipt out of the views.py module.
Also remove some unneeded code and move the code that generates embedded javascipt out of the views.py module.