Update json annotated document format.

 - use unescaped XML inside math elements
 - use integers instead of XML ids aso  math element keys