Refactor reduce_ctx in group, simplify group, remove ungrouped key, value pairs from group results.