Make Enumerable#group_by compliant