Create tmp files more intelligently and improve logging
Removed logging stuff, considering that this will be run under daemonetools