Add proper tests for TeraMath.pow and tweak it to mimick Java Math.pow