code: function massageSelector(input) {
    var result = utils.clone(input);
    var wasAnded = false;
    if ('$and' in result) {
      result = mergeAndedSelectors(result['$and']);
      wasAnded = true;
    }
  
    if ('$not' in result) {
      //This feels a little like forcing, but it will work for now,
      //I would like to come back to this and make the merging of selectors a little more generic
      result['$not'] = mergeAndedSelectors([result['$not']]);
    }
  
    var fields = Object.keys(result);
  
    for (var i = 0; i < fields.length; i++) {
      var field = fields[i];
      var matcher = result[field];
  
      if (typeof matcher !== 'object' || matcher === null) {
        matcher = {$eq: matcher};
      } else if ('$ne' in matcher && !wasAnded) {
        // I put these in an array, since there may be more than one
        // but in the "mergeAnded" operation, I already take care of that
        matcher.$ne = [matcher.$ne];
      }
      result[field] = matcher;
    }
  
    return result;
  }
docs: normalize the selector