Move Javascript into its own file