Makes several efficiency improvements to the dataset export script