define(['dib',
        'events',
        'class'],
function(Dib, Emitter, clazz) {
  
  function Controller() {
    Emitter.call(this);
    this._init();
  }
  clazz.inherits(Controller, Emitter);
  
  Controller.prototype._init = function() {
    var dib = new Dib(this.template)
      , locals = this.willLoadDib()
      , element;
    
    if (this.tagName || this.className || this.attributes || this.id) {
      element = {}
      element.tag = this.tagName || 'div';
      element.attrs = this.attributes || {};
      if (this.id) element.attrs['id'] = this.id;
      if (this.className) element.attrs['class'] = this.className;
    }
    
    dib.container(element)
       .events(this.events, this);
       
    // TODO: Implement support in `Dib` for automatically instantiating views,
    //       which will work similarly to automatic event binding.
    
    this.el = dib.create(locals);
    this.didLoadDib();
  }
  
  Controller.prototype.willLoadDib = function() {};
  Controller.prototype.didLoadDib = function() {};
  
  return Controller;
});

@@ -1027,16 +1027,220 @@
 n() %7B%7D;%0A
+  Controller.prototype.willAddEl = function() %7B%7D;%0A  Controller.prototype.didAddEl = function() %7B%7D;%0A  Controller.prototype.willRemoveEl = function() %7B%7D;%0A  Controller.prototype.didRemoveEl = function() %7B%7D;%0A
   %0A  ret

Add hooks for element add and remove.