fixes #78 refactored query string parsing and processing