Add support for hash queries, and speed-up

Speed-up is for when the query-string does not exist, we simply return undefined and do not set or initialize variables