added a csv encoder and its tests