JSON Export support
Write output to json. Breaks on circular relationship.