Fix MiddleWare registration and execution.

* Only SecurityMiddleware was registered. All others failed silently.
* Execute tests in the same order they were registered.
* White-space fixes.
Adjust test as middleware checks now runs in registration order