Fixed some issues in jsrouting

Removal of werkzeug.templates had left some JS broken
Python 3 compatibility