Add tests for csvparse, fix some caught bugs