Implementation of a lot of tests in math.
Added tests.