Moved icky inline JS to a separate file.

Change-Id: I86422daf6f31fbf301ce3ebdc7f98990b1430bdd