Simplify memoize, enable pickle-compatibility

This may prove useful for caching results of Analysis.