Segment subscriptions into queued/pending/open phases to prevent duplicate subscriptions from being made while identical ones are in progress

If you're unconnected, and you try to subscribe to the same channel a bunch of times, you end up firing off all of those subscriptions. This commit should shore that up.

Also, added delegate callbacks for channel subscriptions and unsubscription, so that clients know when to start or stop trying to publish messages to a given channel.