Refactoring optimization, functions and regression, since they kind of
form a single big concept
Implement least squares through vectors
Refactor regression a bit
Add missing deps