WIP: Ws client code

Modify this function like so:

```javascript
function maybeCallback(err) {
  if(syncCallback) {
    syncCallback(err);
    syncCallback = null;
  }
}
```
Then you can call `maybeCallback(...)` below when necessary.