Update CHANGES and bump to version 0.40
Use File::Path rmtree instead of unlink in the tests