move javascript out of page.xsl and template, clean up namespaces
#238 fixed build for version lt 8