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.
Merge pull request #228 from roshanr95/merge

Merge algorithm