Add an extra check to make sure the MIME part has a Content-Type header

Fixes AttributeError: 'NoneType' object has no attribute 'strip'
Remove boring debug log
Minor cleanup
Improve logging
Fix time_expired error message in workers
Turn off spurious debugging