Add TomDoc, add a logger, some fixes.