Ports auth decorators to work with both Django and webpy

This PR introduces thread unique tracking of the WSGI environ, and updates the auth decorators to use the stored WSGI environment instead of web.ctx.environ if the request is being served by Django. Existing web.py should continue to work the same as before.

Also updates some PEP8 compliance changes within all modules touched.
`thread` is deprecated, `threading` is now favored.

This is what you need:

    threading.current_thread().ident

Though it probably doesn't matter since we won't be using py3 anytime soon.