perftool.py: new, better implementation of stat
perftool.py: clean-ups