Fit: use generic classes and optimize Polynomial() matrix creation
Fit: more direct and slightly faster implementation; add MultiDim
Merge branch 'fit-perf'