Move all JavaScript to the end of the page

It isn't needed at the top and will slow page loading.
Merge pull request #376 from alphagov/js-at-the-end

Move all JavaScript to the end of the page
Fix failing test

We shouldn't care where the scripts are on the page only that they are
there. This removes the check that they are in a specific part of the
page.