Added a file to build an index from a sequence and write to file

Also removed the memory leak from read_index()