Fix memoize decorator: raise instead of storing None

With this fix, we will re-raise an exception that happens
while evaluating the callable, instead of storing None as value.
add cache invalidation
Merge remote-tracking branch 'refs/remotes/kali/bug/fix-memoize' into develop