Separation of CSV module, bug fixes