memoize: Add doctest

Also properly @wrap...