[kpi,query,register] heavy refactoring, new unit tests
[service] added log to the service