Move inlined javascript to its own file.

This allows the javascript to be minified with the rest of it when
running 'grunt build'.