Moved logging to module level.
Added module loggers and improved cleanup on keyboard interrupts.
Moved logging to the module level.