#405 Implement memo method.

#405 Added DyMemo and related test cases.