Add 'Code' to json error response parsing

The XML error response parsing has a 'Code' attribute
as well as a 'Type' attribute.  I've added a 'Code' attribute
to the json errors, which is extracted from the __type
key if it exists.

This is useful for things like retries which are based on the
error codes returned by the services.


cc @garnaat