Move suppressStdOut to IO object.
Consolidate code generation.
Improved code generation that works for nested event handler types.