Create tests for #authenticate; Protect against JSON parsing errors

Previously, the function assumed that all responses coming from
SalesForce had valid JSON in the bodies. This caused unrecoverable
errors in production. Parsing of the JSON in this function is now
handled safely and will return with an error and the original body in
the event that the JSON is invalid.
Create tests for #refreshToken; Protect against JSON parsing errors

Previously, the function assumed that all responses coming from
SalesForce had valid JSON in the bodies. This caused unrecoverable
errors in production. Parsing of the JSON in this function is now
handled safely and will return with an error and the original body in
the event that the JSON is invalid.
Refactor duplicate code into library module
Create tests for #getIdentity
Refactor common test functions into helper
Create tests for #upsert
Protect #getIdentity and #upsert against JSON parsing errors

Previously, the function assumed that all responses coming from
SalesForce had valid JSON in the bodies. This caused unrecoverable
errors in production. Parsing of the JSON in this function is now
handled safely and will return with an error and the original body in
the event that the JSON is invalid.
Refactor 'unparsable JSON' error into lib module
Move 'Connection' tests into test subdirectory