docs: function grouped(array, groups, order) {
    if (!groups) { groups = [returnFalse]; }
    var sorted = [];
    var ordered = [];
    var remaining = array.slice();
    var unmatchedPosition = groups.indexOf('unmatched');
    groups.forEach(function(criteria, index) {
      if (index === unmatchedPosition) { return; }
      var tieBreakers = [];
      if (index !== groups.length - 1) {
        tieBreakers = groups.slice(index + 1);
        if (index < unmatchedPosition) {
          tieBreakers.splice(unmatchedPosition - index - 1, 1);
        }
      }
      var spliced = splice(remaining, criteria, tieBreakers);
      var matched = spliced.matched;
      var unmatched = spliced.unmatched;
      sorted[index] = matched;
      remaining = unmatched;
    });
    if (unmatchedPosition === -1) { unmatchedPosition = sorted.length; }
    sorted[unmatchedPosition] = remaining;
    if (Array.isArray(order)) {
      order.forEach(function(position, index) {
        ordered[index] = sorted[position];
      });
    } else {
      ordered = sorted;
    }
    return ordered.reduce(function(flat, group) {
      return flat.concat(group);
    }, []);
  }