added kv_groupby that assumes your input is a (k,v) tuple