utils: rewrite query processing function.

kdig: add support for TSIG.

NOTE: AXFR and IXFR are temporary disabled!

refs #2137

Change-Id: I95ebbeec695b7cfa49db53f92306b12e7ef19a84