fix subscription server  bug introduced when porting to async, add support for event in server, reorganization

lots of changes. I should have tested more but there are so many changes it is better to merge otherwise it will be hard to merge
In addition to being god practice, i expect the core classes to grow when
more features are added, thus anyway one days we will have to split the
headers out.