Improve tests. Refactor out xml transform function

Improved xml transform tests. Moved xml transform to it's own
module/file.
Also created a generic createCollection function under
transformToCollection. Accepts json, creates a collection, returns
next()
Merge pull request #9 from moroni-pickering/master

Improve tests. Refactor out xml transform function