Memoize module implementation and unit tests