Fix Query so that it does now lower-case the entire query string.
Minor formatting changes and license header additions.