Added port of Dave Herman's memoize package