Function mergeOverlappingPoints

Merges overlapping points using the line-based system Returns updated points and lines arrays