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