Fix json.dumps()

This change lets you use json.dumps() from python.  The previous byte array stuff didn't seem to work.