Simplified 1D and 2D linear interpolation routines and added new function for N-dimensional interpolation.