Initial implementation of algorithms.rewrite_url.

Only the host and port portions of the URL are implemented.