Added JSON format (considering compatibility)

Although there seems to be already some pull requests about JSON, I thought this would be slightly better because of the compatibility with:
other parts of the code and,
python 3.x.