Better parameter handling for `to_str()` and `to_unicode()` methods.
Added `canonicalize_url()` method.