Fixed the part in _write_summary_file that writes out more readable
version of the json-dumped strings such that it now works with both
python 2 and 3. Also used more explicit exception catching.
Merged