7594: power rules correction so (x**y)**z != x**(y*z)

fixes #7594
This has been refactored to consolidate logic (e.g. exp was doing things that Pow wasn't) and to rely on Pow._eval_power to determine whether replacements will take place or not.