Monitoring: Refactorization for performance, thread-safety and cleaner shutdown behavior
This MR improves the shutdown and reconnect behavior, fixing #104 (closed) , and improves the thread-safety, fixing #107 (closed) .
Sorry for the short text, gitlab ate my previous (longer) message