Added some more functionality to the math library, most of which has not been thoroughly tested yet. Unit tests are forthcoming.