Move callback tracking into the closure
Handle errors

Handle errors on the SDK side instead of passing the whole response
along and letting the client determine whether an error happened.

Return an `EventEmitter` and pass along socket `error` and `end`
events from the socket.

Add `.connected`, indicating whether the client is connected.
Use `json-stream` instead of our own implementation

Fix a bug where callback throwing an error would be obscured by the `try
.. catch`.
Merge pull request #4 from nearform/error-handling

Add error handling