Added event handling framework, reduced amount of synchronized code, added configurable ws bind port, added setup for sending data to tools