Fix synchronous errors in bulk.js
Change test script to use the right port
Finish integration tests