Added code that accumulates all the fields defined in each file.  See comments in the code regarding the use of $export_fields.