3788: simplification of powers

https://code.google.com/p/sympy/issues/detail?id=3788

These changes will allow SymPy to recognize `b**(1/log(b))` and `b**(1/(log(-b)+sign(im(b))*pi))` as `E`.