fix(groupBy): preserve groups in order of appearance