Added a function to export data to CSV, and a button for a user to complete this action.