Version of Mergewaypoints with many improvements (snapping, caching, etc.)