Security updates and partial fix for test errors.
Updates key dependencies to remove all high severity vulnerabilities and most medium and low ones. Also partially addresses problems when reusing a single temp directory between test runs. Tests will now run more reliably on everything but Windows.