Added code for collecting stats.
Added a directory for outputting stats to.