Generalized sequence merging algorithm
Extracted sequence merge functionality
resync and updateLocalSequence now runs the same code
Removed unnecessary code
Adapted test case to insync
Merge of remote tracking branch
Moved sequence merge code to sequence.ts