Memoization for Add/Mul

Both now use similarly derived keys for memoization which means we no
longer key a running product for memoizing products. But it also means
we memoize complex products. We memoize sums, too.

Adding singles at the end is properly handled with regards to
memoization and referenced data.