Handle proper map input (doc, meta) vs. (doc)

cbugg: bug-452
Handle non-array key grouping.

cbugg: bug-452