Performance changes and DPS

Changes to improve performance by minimising database use.

DPS is now calculated and split into eDPS/ pDPS.