sendEvent now runs in a goroutine and uses ids.

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>