     children = (child for child in el.childNodes when child.nodeType == 1)
 
     if tagname is 'class'
-      # defer creation of children
+      # defer creation of children if selected by init()
       for child in children
-        # console.log 'creating child', tagname, child.localName, child, parent
-        # console.dir(child)
-        # console.log 'defer', child
         child.$defer = true
         
     processSpecialTags(el, attributes, attributes.type) unless tagname is 'class'

    # console.log 'onunload', localStorage[cacheKey]
  )

  compileCache.bindings ?= {}
  bindingCache = compileCache.bindings
  scopes = null
  propertyBindings = 
    find: (expression) ->
      return bindingCache[expression] if expression of bindingCache
      ast = acorn.parse(expression)
      scopes = []
      acorn.walkDown(ast, @)
      bindingCache[expression] = scopes
      # console.log compileCache.bindings
      # return scopes
    MemberExpression: (n) ->
      # grab the property name
      name = n.property.name

      # remove the property so we can compute the rest of the expression
      n = n.object

      scopes.push({binding: acorn.stringify(n), property: name})
      # console.log 'MemberExpression', name, acorn.stringify n
      return true
  # propertyBindings.find = _.memoize(propertyBindings.find)

  compileCache.script ?= {'coffee': {}}
  coffeeCache = compileCache.script.coffee
  compilermappings = 
    coffee: (script) ->
      if script of coffeeCache
        # console.log 'cache hit', script
        return coffeeCache[script]
      if not window.CoffeeScript
        console.warn 'missing coffee-script.js include'
        return
      # console.log 'compiling coffee-script', script
      coffeeCache[script] = CoffeeScript.compile(script, bare: true) if script
      # console.log 'compiled coffee-script', script
      # console.log coffeeCache
      # return coffeeCache[script]

  transformScript = (script='', compiler) ->
    return script unless compiler of compilermappings
    script = compilermappings[compiler](script) 

  # cache scripts to speed up instantiation
  scriptCache = {}
  compileScript = (script='', args=[]) ->
    key = script + args.join()
    return scriptCache[key] if key of scriptCache

    catch e
      console.error('failed to compile', args, script, e)


  class Node extends Eventable
    matchConstraint = /\${(.+)}/

    # generate a callback for an event expression in a way that preserves scope, e.g. on_x="console.log(value, this, ...)"
    eventCallback = (name, script, scope, fnargs=['value']) ->
      # console.log 'binding to event expression', name, script, scope, fnargs
      js = compileScript(script, fnargs)
      ->
        if name of scope
          args = [scope[name]]
        else 
          args = arguments
        # console.log 'event callback', name, args, scope, js
        js.apply(scope, args)

    constructor: (el, attributes = {}) ->
      @subnodes = []
