add math.lua, move all math related helpers in to it