Add option to pretty-print json encoding