Make event.h the single source of truth about event encodings.

#802