Moves the javascript tag into the head for the generated templates.

This is necessary to work with rails 4 turbolinks.