Implement event handlers using event extension.

Closes #26.