Sanitize query by using the querystring module. Fixes #4