update how obj.ready is updated and add unit tests
fix unit tests
fixing the pretest script that was cloberring the scope of mocha