some cleaning/reorg of modify_contig
REAL indel fixing in refine1 and refine2 steps