Extract JavaScript code to separate files.