Started implementing CSV encoder test
Fixed some bugs and added tests