code: function Class(parent, api) {
      if ( !api) parent = (api = parent, 0);
  
      var clazz, constructor, singleton, statics, key, bindTo, len, i = 0, p,
          ignoredKeys = { constructor: 1, $singleton: 1, $statics: 1, prototype: 1, $super: 1, $superp: 1 },
          overload    = Class.overload,
          plugins     = Class.plugins;
  
      api         = (typeof api === "function" ? api() : api) || {};                                 // execute api if it's a function
      constructor = api.hasOwnProperty("constructor") ? api.constructor : 0;                         // hasOwnProperty is a must, constructor is special
      singleton   = api.$singleton;
      statics     = api.$statics;
  
      for (key in plugins) { ignoredKeys[key] = 1; }                                                 // add plugins' keys into ignoredKeys
  
      clazz  = singleton ? {} : (constructor ? (overload ? overload("constructor", constructor) : constructor) : function(){});
      bindTo = singleton ? clazz : clazz.prototype;
  
      parent = !parent || isArray(parent) ? parent : [ parent ];
      len = parent && parent.length;
      while (i < len) {
        p = parent[i++];
        for (key in p) {
          if ( !ignoredKeys[key]) {
            bindTo[key] = p[key];
            if ( !singleton) { clazz[key] = p[key]; }
          }
        }
        for (key in p.prototype) {
          if ( !ignoredKeys[key]) { bindTo[key] = p.prototype[key]; }
        }
      }
  
      for (key in api) bindTo[key] = api[key];
      for (key in statics) { clazz[key] = bindTo[key] = statics[key]; }
  
      if ( !singleton) {
        p = parent && parent[0] || parent;
        clazz.$super  = p;
        clazz.$superp = p && p.prototype ? p.prototype : p;
      }
  
      for (key in plugins) { plugins[key](clazz, parent, api); }                                     // pass control to plugins
  
      return clazz;
    }
docs: Create a class.