CSV Export - adds referrer

This make the CSV export much much more useful being that it will now have the referrer_id. Now you can just open the CSV in a spreadsheet or processing script and do all the calculations for user earnings.

To note: CSV is the only exportable format that gives you 10,000 rows. Both JSON and XML are limited to 30, so CSV is the most important format to export all the details to.
I believe your actually overriding the below. The csv do block should go in the .register block below.