Biggest change: compute basic statistics and frequency tables.

Lots of bug fixes too.

Code is getting a bit unwieldy. Should think about a more general
framework for manipulating CSV data. (I knew this was coming.)