Added new macros DBG() to library/queryutil.h
Work in progress.

Added some todo-s.
Wraped SetlogFeature into lambdas.