handle with care Pow and rational expressions during simplification

The tests in Wester point out that simplification should
give priority to handling the denominator first and not
allow a term to factor out that would then change a zero
there into a non-zero term. e.g. getting (after simplification)
cos(x)**2 + sin(x)**2 - 1 over the same expression does
not make it 1: it is 0/0, nan.

The same issue exists when simplifying a Pow: the base should
be handled first to see if it becomes 0 else something like the
expr.py doctest, z(x)**(x + 1) where z(x) will simplify to zero
might become zero: z(x)**x*z(x)**1 = z(x)**x*0 = 0. This actually
suggests a problem in Mul.flatten if a zero argument short circuits
to 0 overall without knowing if there is any term for which
its boundedness is not known (since unbounded*0 is nan).