Moves inline JavaScript to its own file