Escape query strings

Fixes #324 
This seems like a better way to handle it  :)