new communication abstraction and random fixes

Signed-off-by: Jan Dvořák <mordae@anilinux.org>