Improvements to `deprecated`

- Raises a DeprecationWarning
- Function to clear up the global cache