added fix for closing socket on unsubscribe and changing connection mode from MX to non-MX connection.
Merge branch 'master' of github.com:pubnub/javascript