rewrote tests to work with commonjs
edited build script to comply with commonjs