Fixes for an exception on certain requests.

- Adding a default 'Content-Length: 0' header. This solves an issue with the PandaStream API occasionally returning a 411 error.
- Adding a try/catch block around the parsing of the API response so that if the response can't be parsed as valid JSON (as with the HTML error body) the client will return the raw text of the response instead of throwing an exception. In the long run it would be much better to switch to a standard callback format of callback(err, response) so that such errors can be handed back to the user of the client to be dealt with in an elegant way.
- Fixing a scope with the variable containing the parameters sent to PandaStream for an API request. Now unique parameters for each request are local to that request only instead of being saved to the parent scope with the local option variable being ignored.
- Some other minor stylistic changes may have slipped through from my JavaScript linter.