pub sub event loop refactored; it can be started and stopped, and these are called from Global onStart and onStop

Signed-off-by: Mikolaj Szabo <savingprivateblue@gmail.com>