Added utilities with memoize decorator and tests.