Bump to csv 0.4.0 and use streams everywhere