Add tests for adapter. Fix some bugs.

It appears that after subscribing node for messages it need some time to
wait before recieving messages. But there is now WaitForConnection
function for subscriber (as it is for publisher), so the current
decision is to sleep for 100ms after subscribing. Experience shows that it is enough.