fixed #1412; Subdocuments use their own transform

Made it such that subdocuments will use their own transform function
instead of their parent's when `toObject()` is called
Merge pull request #1620 from 10gen-interns/gh-1412

fixed #1412; Subdocuments use their own transform