Add generic Cholesky decomposition and make Cholesky parametric on matrix type plus some fixes.