Some improvements to logging and error reporting.
Updating cli utility.

Dropped trace option, added stats option for outputing stats to STDERR.
Some cleanup.
Adding cli utility test.
Some markdown tweaks.