Changes to differentiate between an absent and an empty query string

For example
 * when parsing `/a/path` the query is `None`
 * when parsing `/a/path?` the query is `Some("")`