Fixes #63 (REST and CLI errors under Tomcat)

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)