Fix `current_user` in templates

* Also rearrange how javascripts objects are included