Fixes #68 (RESTful errors not handled properly)

This pull request adds code to properly handle errors in the response from the Hanlon server (it will now throw appropriate errors rather than trying to always handle the response that comes back, which may include a generic HTML payload from the server, as if it were JSON)