Modified the algorithm to use a faster plane sweep algorithm.

The plane sweep algorithm has a better complexity ( O((n+m)log n) instead of O(n^2), and scales to a large number of curves.  While it is more work to calculate intersections, removing overlap becomes much easier.