changed query string extraction code to select everything after the first '?'
added proper key, value parsing for query string parts.

Also, refactored query string extraction to two lines.
fixed refactor of query string extraction.
fixing path parsing in dev branch.