Added math functions and refactored number classes to use interfaces instead.