Added ability to use require in settings.js.
Added ability to load middleware from settings file.