Next function.
Calls the next middleware in chain.
function next() {
    var middleware = chain.shift();

    if (middleware && typeof middleware === 'function') {
      middleware.call(this, context, next);
    }

    return this;
  }