Fixes #8210 - Adding caching for smart-proxy puppet classes using Stefan Julin's implementation of cache

```assert klasses.any? { |k| k.name == 'sub::foo' }