Implement query_raw

This should be a pretty quick review.

r?