Move GetSlope function to math.

Also made all math.go functions private.