Move main.py to page.py and count features

Count features by stat for raw stats, and by mean stat for
permuted data.