bwa mem aligner module cleanup

I need to work on the bwa mem aligner code soon. This is a bit of initial refactoring + adding test cases to make that easier for me to do.