Further updates to url rewriting and modified wsgi.py.