Adapt import statements.

In previous commit logging and services packages were renamed. Fix
import of this packages in code and example.
Rewrite perform_sync in Service as generator.

All of the improvements associated with synchronously access to the
services.
Fixes a problem with incomplete reading of the socket buffer, which
happens when using the service synchronously several times, as well as
for mixed use (asynchronously after the synchronous). As well as
properly processed error message from the service.