Cleaned imports
Fixed deffered resolution chain
Fixed thread-based querying with sqla