Bugfixes and improvements

Clients and servers now have an internal loop reading all events
Loop reader separates events from api and command responses, and send
them over the appropriate channel