convert to events and dramatically simplify

Now also completely incompatible with the libvirt module,
but I am working on that too.

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