Factored out export code to facilitate move to EnsEMBL::IO further down the line