Normalize URI() behavior across Ruby versions
url - A String or URI.
Returns a parsed URI.
Recursive hash merge
Recursive hash update
Stolen from Rack
Receives a String or URI and returns just the path with the query string sorted.
Adapted from Rack
[Validate]