(toQueryParams): Properly support spaces and the empty string in filter
strings.