Added support for first-class events. Fixes #16.