Event handling changes and other architectural changes in WSGI.
Some event handling changes.
Merge branch 'unstable' into feature/qt
Changed event handler in Qt to match WSGI.