Factor the JS out to a separate file.