anchor.diff:    ignores elements that are being [destroyed](/up.destroy) or that are being
     removed by a [transition](/up.morph).
   
  -  If the given argument is already a jQuery collection (or an array
  -  of DOM elements), the first element matching these conditions
  -  is returned.
  -
     Returns `undefined` if no element matches these conditions.
   
     Also see the [`.up-destroying`](/up-destroying) class.
   
     @function up.first
  -  @param {string|Element|jQuery|Array<Element>} selectorOrElement
  +  @param {string} selector
     @param {string} [options.layer='auto']
       The name of the layer in which to find the element.
   
  
positive.code:       u.remove(layers, originLayer)
        layers.unshift(originLayer)
      u.detectResult layers, (layer) ->
        return firstInLayer(selectorOrElement, layer)
  
    firstInLayer = (selectorOrElement, layer) ->
      elements = e.all(selectorOrElement)
      return u.detectResult elements, (element) ->
        if isRealElement(element) && matchesLayer(element, layer)
          return element
  
negative.code:     or `undefined` if no such element was found.
    @experimental
    ###
    first = (selector, options) ->
      options = u.options(options, layer: 'auto')
      selector = e.resolveSelector(selector, options.origin)
      if options.layer == 'auto'
        firstInPriority(selector, options.origin)
      else
        firstInLayer(selector, options.layer)
  
    firstInPriority = (selector, origin) ->
      layers = ['popup', 'modal', 'page']
      if u.isPresent(origin)
        originLayer = layerOf(origin)
  