CSV improvements from 2.6.1

This is a port of all the CSV changes in 2.6.1, but doesn't yet include the changes currently on develop.

Can someone review and check if more is needed for pybossa integration?