Add a merge-path based merge algorithm and change merge to use it

Added a merge_path kernel and a merge algorithm based on it.
Also changed merge to use the new algorithm.