CSV module not used directly here.
switch to csv module for CSV writing instead of ad-hoc approach.
sync XML files
use mode setting explicitly; add default log level to config.
Add basic testing framework. Fixes #36.