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.