DB tests passing for stats

This means we can now do insert/update stats if needed at an appropriate performance penalty (needs better documentation)