allow custom headers to be passed to to_csv(); closes #1611