As we mentioned on Hangouts, I think we're close here, but lets use csv.DictWriter to clean this up a lot more.