halfway through to working statistics
stats working
- todo: Histogram must be reworked to use the DatabaseStats class instead of own impl.