Including request IDs in error msgs if possible

Errors raised on unexpected HTTP return codes now include
the x-request-id value whenever possible.

+

Some minor updates and testing suite improvements.