deal with multipe match correctly. support gzip.

fixed a bug where multiple alignments for a read are not correctly processed.
the output is compressed with gzip.