Changed to use standard modesttree debugging and logging tools.