Fix issue #2969: correct guess for number of series terms of f(x) for (f(x))**a
order.py: implement simplifications of powers (e.g. O(x**sqrt(-x)) -> O(x**(S(3)/2)))