Adding the ability to use Middleware

This patch adds the possibility to use `Middleware` in the static part, but it should be possible to use it everywhere; possibly moving gzip there too.
I am not sure about Aeson type classes; or exact format for the config.

middleware is applied from the bottom up.