Refactored fasta index file IO.