Change Galimatias test so that search and hash values are comparables

Search:
If url is null, or its query is either null or the empty string, return the empty string.

Fragment:
If url is null, or its fragment is either null or the empty string, return the empty string.

This commit uses URLUtils' rules to generate search and hash from query and fragment.