Add flag parsing to README

Refactor stats.cc