Fix middleware code to allow using it without going through Router class / HTTP
Merge pull request #77 from andig/parameters

Fix middleware code to allow using it without going through Router class / HTTP