Dumping JSON

No need to use encode when JSON.dumps is used;
Use constant for width instead of literal;
Add some comments.