add before_request and after_request calls to controller.

also make sure that server restarts clients when exiting
don't cache compiled templates when in dev mode