Reverse proxy fix, for issue #318

This PR is based on https://github.com/nodejitsu/node-http-proxy/pull/376, with the following changes:

* Rebased off of latest master
* Added support for reverse-proxying HTTP 303 and 307 responses