refactor report view to make it thread safe
refactor doctype to make it thread safe
refactor for webnotes.conn.sql
Merge pull request #261 from pdvyas/wsgi

Refactorings to remove globals