Fix javascript appearing before DOCTYPE

Put the javascript_include_tag and the inline script in body_end; they'd
accidentally not been put in a content block, and so were appearing
outside the content at the top of the HTTP response.

Remove the duplicate javascript_include_tag from head.