Move middlewares to a separate module

Perhaps those should go into a separate package even.
Bump version