Fixed some issues in jsrouting

Removal of werkzeug.templates had left some JS broken
Python 3 compatibility
Merge pull request #579 from pferreir/fix-jsrouting-issues

Fix jsrouting issues