Added methods for setting the connected and disconnected callback blocks separately, and added listening for disconnected events.