Moves JS to separate file