templates: move .js from base.html to a new base.js template