Moving most in-page Javascript to a separate file.

This includes most of the JS that runs after the page has loaded.
Removing test code that blocks JS features using query-string.