The Exporter should be able to come pretty close to the required insert order, with the exception of the cases where we're manually making references (perhaps we should stop doing this?).
We could have the exporter add nodes to a DAG with edges for each reference. Then it could either output the insert order to a metadata yaml file to accompany the exports, or at least output it so the user can copy it, instead of having to manually calculate the topological sort.