Refactor to make request/response available.

Also refactored the tests to get them to use the response.write and
Rack::Test.