Break middleware into two pieces, one for request and one for response.

This allows *other* middleware that alters the /response/ based on url
information to work properly.

Added in class + DeprecationWarning for backward-compatibility.
Fix tests.
Merge pull request #17 from philipn/allow_url_in_response

Break middleware into two pieces, one for request and one for response.