Fix handling of URL fragments.

Encode and decode URL fragments in iri_to_uri() and uri_to_iri().