Add support for widget event listeners to be specified as functions
Switch the notifier and modal mechanisms to use the new widget mechanism

Note the use of the `$tw.rootWidget` to collect together the root event
handlers