Allow access to headers when using synchronous mode

When making a synchronous request, only the response body was accessible in the result.

This replaces the custom text body logic with a JSON object which transfers statusCode and headers.