Event-driven interface

Resolves #8