refactoring main.cpp, gswalign factored out
flattening of alignments into reference space