Merge pull request #3 from tkiapril/sqlalchemy

Sqlalchemy & Refactoring
db engine created on worker process init
Handle some exceptions

IntegrityError, FlushError and MultipleResultsFound exception are now handled.
This commit is functional.