Improved Flatten and Embed

FlatJSON and EmbedJSON now handle lists of json objects better.  Also,
minor changes to GetENCODE error printing.