Fixes bug 978098 - Accept query string parameters in the middleware.
Correct use of query strings in tests.
Switch to using query strings instead of path-based middleware URLs.
Remove support for path-based URLs in middleware, correct all web app unit tests.