moved csv stuff into csvtool. embed now remembers globals