Improved build scripts
Fixed unit test for main.js