Add middleware library functions.

These middleware include the error handling middleware and embeds
middleware. The embeds is responsible for initializing the
res.locals.embeds object so that controllers can easily push their
assets to this object.

The error handling middleware is responsible for errors that occur
within the application and displaying the error page to the user.
Add error message to promise.reject() example.
Use embeds and error handling middleware.
Defer to embed and error handling middlware.

This function now relies on the emebeds middleware to initialize the
res.locals.embeds object and will no longer do so itself.

Also, error handling for routes not specified is delegated to the error
handling middleware.
Add promise.reject() error object passing example.
Defer to error handling middleware to render errors.

The app controller will now call next(err) for errors. This will invoke
the error handling middleware, which will handle error rendering.
Return error message in a rejected promise.