Completed interpoint distance thresholding and added tests for icdf.  BUT too slow, so started parallelising.