404 on Delete yields client SDK nullref (1420534)

* Changed logic for error parsing to detect XML or JSON based on the payload
* Added support for JSON errors nested inside an `error` object
* Exposed `ParseXXX` methods to be used in PowerShell
* Added unit tests