custom query strings

Handle extra complaints about #1119.

This PR also adds a few "missing" features:

- Support for `_query` and `_anchor` options to `request.static_url` when the url being generated is an external URL.
- Anchor tags were being improperly encoded, they are now quoted.

I have not yet updated the docstrings and changelog. I will gladly do that after review.