reworked nodejs classes
bug fixing
added pubsub