Move JavaScript to its own file