He could have just used SVG path syntax which would have been a lot more compact that the current syntax.
{"p2":{"x":141,"y":85},"mode":"line","p1":{"x":34,"y":44}}
becomes M 34 44 L 141 85
and of course also has ways to express curved paths, etc.