Use a FakeRequest object to test middleware

swift was being imported to provide a blank Request
object but very little of the functionality in that
object was being used. FakeRequest provides the
bare minimum funcionality required:

* REQUEST_METHOD
* PATH_INFO
* wsgi.input based on cStringIO
* custom header manipulation

Other functionality from swift has either been
duplicated or replaced:

* InputProxy (which counts bytes of request bodies)
  has been duplicated.
* logging uses common log functionality
* path_split does straight string splits for the desired results

Note that these changes do nothing to change functionality nor
anything to address the performance concerns being evaluated
and discussed elsewhere.

Closes bug: 1285388

Change-Id: If0fbb8f00765ac915e5b426a3661492f4b4df9f4
Merge "Use a FakeRequest object to test middleware"