This essentially mounts the application as middleware within another
connect server under the specified prefix. This means that when
redirecting that helpers.url() must be used to get the full path and
req.path will be missing the prefix.
This seems a little hairy but essentially avoids creating modules
with factory functions which seems very clunky. We now provide various
helper functions that are bound to the application state such as
url, routing and models via the request object. This is massively
overloading this object but seems to be the common way in Express
apps to pass state into handlers.