[CHORE] API changes and test improvements.

Changed structure of data returned by APIs.
Use assert.ifError instead of assert(!err)
Use assert.equal(typeof foo.bar, 'string') instead of assert(bar in foo).
Callback function is called "done" by convention.