Major rewrite of the cleanDirTree script.