Updated UrlQueryHelper to use Query object instead of terms array.