Modified CSVtoG4 so it is easier to use and added unit tests