Improving tests (adding test cases, formatting).
Improving tests (adding test cases for replace_infinites and minimize_along_direction functions).