First stab at making sql logging threadsafe
Moved from depricated threading API to shiny python3 newness
Cleanup sql.py
minor sql cleanup
sql fixes