Change rcAttempt to hasConnected for readability.
Fix onopen being triggered after close explicitly called.
v0.2.4