Sam: implementation of mate operations

* fix off-by-one bug on Sam::alignment_stop (it was reporting the base after the last inclusive base, contradicting the docs)
* refactor cigar operator parsing routine from SamBuilder to Cigar class for mutual use
* add consumes_read_bases and consumes_reference_bases as static methods to the Cigar class
* add tests to the new API and all new functions

fixes #6
Add note here that bam_endpos() returns "the coordinate of the first base AFTER the alignment, 0-based", so that we don't get confused and think this is a bug later