Restore backwards compatibility with the blob.json property

Adds a to_json method that takes same arguments as json.dumps
Also fix a problem displaying a repr for a blob when the text is a
non-ascii character