Use indep. logging, shutdown callback, manual tests

* Independant logging to file
* Shutdown callback is asking sender to stop everything
* fixed some errors. it works again