Use cowlib to construct query string.

Rather than do it manually.