Category methods on NSArray to support grouping.