Moved the statistics stuff from db plugins #121