Change: RestApplication to accept pre/post hooks

Some middlewares have been converted to hooks.

The tests have been updated too account for the package
changes and hook additions.

Templates have been changed to use new features.

Signed-off-by: Kevin Conway <kevinjacobconway@gmail.com>