Split script.js into main.js and util.js
Split script.js into main.js and util.js
Deep copying and better scoping