Fixed null reference issues. Added Collection level flattenCollection functionality

Now you can specify collection flattening at the collection level and
also at the global level settings. All null values are now rendered as
empty strings in the CSV file