Intermediate commit (won't compile, won't run) to save my work.
Changed subscription code. More refactorings to follow.
added threads and callback