Some JS refactoring and added participant stats (backend only)