Some initial work on graph.toJSON