Extract main JS to separate file.