Event handling changes and other architectural changes in WSGI.
Some event handling changes.
Fixed tests.
Added sorting to result sets.
Added with statement support in datalayer.
Fixed tests after refactoring.
Merge branch 'unstable' into feature/datalayer
Removed test data.