export_data management command, code cleanup (bug 996665)