A many-to-many version of underscore's _.groupBy