added flexibility to the header() function that extracts chromosome names and lengths from SAM or BAM files