Refactor query logic to reduce program size.

Simplified the query logic to reduce the program size and take up less flash memory.

Tested by querying MDNS names from Linux and Mac OSX machines.
Merge pull request #2 from adafruit/refactor_simplify

Refactor query logic to reduce program size.