Add a mostly-specced sum_cache implementation.