Split main.js into separate JS files