Attempt to condense Javascript

Remove JS from template files
Merge branch 'Unify-JavaScript'

Conflicts:
	converted_pdf.html