Added support for triangles and to Json.

Triangles are a new shape / type that can be used in group by.
Added Generate Json buttons to generate output JSON from the simulated output stream.