CSV refactoring to make its dependencies simpler.  Test cleanups.