anchor.diff:      A jQuery collection of matching elements.
     @experimental
     ###
  -  all = (selectorOrElements, options) ->
  +  all = (selector, options) ->
       options = u.options(options)
  -    resolved = e.resolveSelector(selectorOrElements, options.origin)
  +    selector = e.resolveSelector(selector, options.origin)
       root = options.root ? document
  -    matches = e.descendants(root, resolved)
  +    matches = e.descendants(root, selector)
       e.select matches, (match) ->
         isRealElement(element) && matchesLayer(element, options.layer)
   
  
positive.code:     or `undefined` if no such element was found.
    @experimental
    ###
    first = (selectorOrElement, options) ->
      options = u.options(options, layer: 'auto')
      resolved = e.resolveSelector(selectorOrElement, options.origin)
      if options.layer == 'auto'
        firstInPriority(resolved, options.origin)
      else
        firstInLayer(resolved, options.layer)
  
    firstInPriority = (selectorOrElement, origin) ->
      layers = ['popup', 'modal', 'page']
      if u.isPresent(origin)
        originLayer = layerOf(origin)
  
negative.code:       u.remove(layers, originLayer)
        layers.unshift(originLayer)
      u.detectResult layers, (layer) ->
        return firstInLayer(selector, layer)
  
    firstInLayer = (selector, layer) ->
      elements = e.all(selector)
      return u.detectResult elements, (element) ->
        if isRealElement(element) && matchesLayer(element, layer)
          return element
  