Cleaning up tests, removes exceptions.

This removes all the exceptions that were occurring in `Context.__del__`, does some small refactoring in the key cleanup methods, and reduces the number of leftover keys.