Moves JS into external file