```js
Q.all(teardownCallbacks.map(function(name) {
  return Q.nfcall(teardown, name);
})).then(function() {
  // Fire an event to allow third
  // parties to hook into this change.
  // module.fireStatic('statechange');

  // Run setup callbacks if any.
  return Q.all(setupCallbacks.map(function(name) {
    return Q.nfcall(setup, name);
  });
}).then(function() {
  module.fireStatic('statechangecomplete');
});
```