crockford memoize for factorial and fibonacci