Rename export variable and add check for /export.
Pull out data export script for reuse elsewhere.
Remove hardcoded exports.