Use Context Manager for reading JSON configs

Avoids leaking a fd when there's an exception.

Change-Id: Iacd10edc58037192a2e710c47a6caf0da40c6d71
Handle exception messages with six.text_type

Handle exception messages with six.text_type tools instead of using
string. This is necessary becase a message can contain
non-ascii characters and it can cause the unicode error:
"UnicodeError: Message objects do not support str() because they may
contain non-ascii characters. Please use unicode() or translate()
instead."

Change-Id: I3312b75731c1ce49e2f1069c83e1a868805409d3
Closes-Bug: #1273301
Merge "Handle exception messages with six.text_type"
Merge "Use Context Manager for reading JSON configs"