Move javascript into its own file