fixed bug for converting root level objects to CrateDocument/CrateArray.
added test cases