Added more tests and regressionFunction method.

Added a convenient function object that can compute the regression
function once initialized with the regression coefficient.