7594: factor(sqrt(x**2)) != x

logic in factor allowed sqrt(x**2) to become x. This has now been removed.
This breaks some trig manual_integrate results that are fixed in the next
commit.

In keeping with similar simplifications that are made to
spherical harmonic functions (sqrt(sin(theta)**2) -> sin(theta) because
of the assumed range of theta which makes sin(theta) positive), the
pattern sqrt(1-cos(theta)**2) is replaced with the simpler sin(theta),
too.
Impose domain restrictions in trig sub integrals
remove positive kernel check from powdenest

It is not always true that (p**x)**y = p**(x*y) if p is positive.
It depends on the value of x. e.g.
>>> e = 3 + I
>>> r = Rational(1, 3)
>>> b = .02
>>> ((b**e).n()**r).n(2)
0.014 + 0.014*I
>>> (b**(e*r)).n(2)
0.0053 - 0.019*I