allow the dbsession to be a callable
py3 support
short circuit if you have defined a session on the request
Merge branch 'master' of github.com:sontek/hem

Conflicts:
	hem/db.py
	hem/text.py
Fixed bug with callable and scoped_session