Enhance rewrite middleware.

Changes:
- Replacement pattern is applied to the whole URL string rather than just path that lets to rewrite, for example, protocol.

Enhancements:
- Ability to use variables in replacement patterns with standard Go's templating engine syntax (http://golang.org/pkg/text/template).
- Ability to alter replace template variables in response bodies.
This operation is potentially very expensive, can you make it optional (as a flag?) otherwise it will slow down cases with large responses