Added const to tsv_create and tsv_open arguments.
Added unit tests.