inverted header parser

This fixes a 'stack overflow' when parsing BAM headers with lots of
reference sequences.  Also enhanced usability of bam-fixpair.