Cleanup and refactor. New util and config files.
Set pool_recycle so that DB connection is refreshed properly
Add better exception-handling to worker protocol