EmbedJSON fix

fixed EmbedJSON to not overwrite list of IDs with a single ID.  It now
recreates the list of IDs with embedded objects, and checks to make
sure the length of the list is identical to the original list.