Parametrized PORT, integrating middleware tests.
Middleware-mode testing implemented.