xEcon database rewrite compatibility

Merge this branch if xEcon PR is merged
StatsCore compatibility
Suppressed PhpStorm inspections :P