Create a function to export all the in memory loaded circutit to a netlist file in JSON format, like the ones generated by Yosys.
One of the goals of it is being able to use the JSON files to view the circuit diagrams with other tools.
Example: https://github.com/nturley/netlistsvg