Rudimentary event-handling base. Completes #7.