Renamed CacheMixin.cache to _cache

Corrected a bug in _cache() as well: return the input function
unchanged if self.memory is None.