More complicated solution to json encoding with str vs unicode.
Automated merge for py3k testing