Adding logging configuration to log to a file rather than the console

I realize there are a lot of changes in this pull request, especially in the worker.py. I have basically added logging to all places and removed the print statements.
Let me know if this makes sense, please.