First proper commit, added math

Added some math functions and a primitive interface.