[#5453] Remove old stats.py file, improve userstats code