Added support for middleware classes, and factories.
Merge pull request #13 from Battlefy/feature/better-middleware

Added support for middleware classes, and factories.