Finished WSGI refactoring