Adding the test and the code for the samtools flagstat function