Refactor correlation functions into proper basis function class hierarchy.
solve the correlation matrix vs covariance matrix issue