Implemented basic math library

Lots of boilerplate code.