Some work on generating event handler types.

related to #23