Rewrite the spice exporter to work with the new simulation model architecture and data model, with many bugfixes related to the latter two along the way.