Updated to work with mod_wsgi
Updated to work both standalone and with mod_wsgi.