Sorting intersecting targets based on distance.

This commit fixed/enhances jsPlumb drop behaviour: https://github.com/sporritt/jsPlumb/issues/261
The new connection gets created to the nearest endpoint to the drop position.