WSGI app handler loading changes

Changes to bring app handler loading into line with Django and fix a threading issue. **This will break compatibility with py25**