algorithms: Refactor rewrite_url.
algorithms: Refactor rewrite_url.

Extracted _create_url_identifier and _normalize_host functions since
they will be handy in the future (for URL canonicalization) and it
reduces some of the unnecessary line noise.

dave-shawley/ietfparse