Memoize

In order to improve code readability, renamed Generate to Write and
Parse to Read, and made both classes inherit a base Memoize. Now it is
clear that these classes work with an evaluation memoization.