Add pow() function

Add `pow()` function. In addition, convert `squareRoot()` and `invert()` to use `safePow()` instead.

Refs #803.
I sorta think this should return NaN or something instead of silently eating the domain error.