Add algos/mergesort implementation.

+ small refactoring.