Reduce the utilization of superglobals in tests.
Merge pull request #845 from jails/refactor/request-tests

Reduce the utilization of superglobals in tests.