Add code for getting the cigar string and flags

Code pulled up from gatk-tools-java. Thanks Ilia!