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