Fix bad json message sent by AutoDiscoveryThread. Add first version of auto discovery test.