[WIP] Csv dd cleanup refactor

@Francesc, this is me rebasing your pull requests #97 and #90.

I'm getting a lot of errors still, can you look at them before we push?