handle RegisterResponse errors

This PR allows `RegisterResponse.load_from_json` to accept a JSON string including an `errorCode`. A `RegistrationError` will be raised with the error code and some details.