Update the package for the latest APIs
Add tests to ensure that cleanup happens