provide a cleaner API for clients that preserve event order on the same thread

it's been found that in some cases (buggy server) a client can get into a state
where connects are received aftrer disconnects. in such a case, if a user implements
an auto reconnect feature then their client can end up in a state where it infinitely
tries to reconnect because disconnects/connects are out of order.
the updated implementation ensures that this doesn't happen as long as the events occur on
the same thread.
in addition, it makes a cleaner user interface