make bealign more like aligner, misc refinements to SamIO and BamIO (write() returns count of records written)