Feature/distance

1) fix bugs in the segment-box distance computation code
2) add alternate algorithm for computing segment-box distances (used for verification in unit tests)
3) re-factor common code (use point_to_range instead of have custom code with the same functionality)