watch for negated base pairs

In theory this problem should be handled by signsimp but
sqrt(-(x - z)) signsimp only looks for things that can have a negative
sign exptracted so (x - z)/sqrt(z - x) becomes (x - z)/sqrt(-(x - z))
and that doesn't simplify unless we look for the negated base in powsimp.

Only a minimal attempt is made to find the negated pair. If one desires
other things like x + y*(z - x) to be recognized as the negated expression
of -x + y*(x - z) then signsimplification should be done first.

>>> (x + y*(z - x))==(-(-x + y*(x - z)))
False
>>> signsimp((x + y*(z - x)))==signsimp((-(-x + y*(x - z))))
True

Number that are negated are handled elsewhere so these are sepcifically
exclluded from consideration by the added code.
Move all statistics related tests into the statistics module

This module is deprecated, so keeping the tests together makes it easier to
ignore the deprecation warning during the tests (which otherwise raises an
error).
Merge pull request #2115 from asmeurer/statistics_deprecation

Move all statistics related tests into the statistics module
Merge pull request #2111 from smichr/powsimp

watch for negated base pairs in powsimp
x.replace(x, y) -> y
sympify replace input
Merge pull request #2118 from smichr/replace

x.replace(x, y) -> y
Merge pull request #2122 from smichr/replace

sympify replace input
refactor the Miller-Rabin test code

also use pow(b, 2, n) rather than b**2 % n which is a bit more efficient
use ZZ(base) in isprime
Merge pull request #2119 from smichr/isprime

refactor the Miller-Rabin test code