Updated Operators.sum to use foldLeft
(to save memory, and to work when dom is a Set)