Switch to plain-old-struct event API
Update showimage demo to use new events API
Add controller and user-defined events