move JS from HEAD to BODY

This is still pretty inconsistent with the rest of the app, and hard to test, but fixes the bug.
Merge branch 'patch_users_view'

Rebased and merged pull request #241