Fixed a problem in PiecewiseLinearInterpolation.

If the point to interpolate the value on is not located in any interval we choose either the first or the last interval and extrapolate the data. The algorithm for the determination of the interval is corrected.
Added a version sorting a vector and a second vector according to the first.
Sorting the input according to the support points.