Split script.js into modules and main.js