       @types = attributes.types ? {}
       delete attributes.types
 
-      methods = attributes.methods
       # Install methods
-      for methodname, method of methods
-        if methodname of @
-          invoke = () =>
-            supr = @[methodname]
-            meth = method
-            @[methodname] = () =>
-              # console.log 'applying overridden method', methodname, arguments
-              supr.apply(@, arguments)
-              meth.apply(@, arguments)
-            # console.log('overrode method', methodname, @, supr, meth)
-          invoke()
-        else
-          # console.log('installed method', methodname, @, @[methodname])
-          @[methodname] = method
+      for methodname, method of attributes.methods
+        installMethod(@, methodname, method)
       delete attributes.methods
 
       # Bind to event expressions and set attributes

      CoffeeScript.compile(js, bare: true) if js

  compileScript = (script='', args=[], compiler) ->
    if compiler of compilermappings
      # console.log 'compiling coffee-script', compiler, script
      script = compilermappings[compiler](script)

  typemappings = 
    number: parseFloat

  installMethod = (scope, methodname, method) ->
    if methodname of scope
      # Cheesy override
      supr = scope[methodname]
      meth = method
      scope[methodname] = () ->
        # console.log 'applying overridden method', methodname, arguments
        supr.apply(scope, arguments)
        meth.apply(scope, arguments)
      # console.log('overrode method', methodname, @, supr, meth)
    else
      # console.log('installed method', methodname, @, @[methodname])
      scope[methodname] = method

  class Node extends Module
    @include Events

