Foldable and Traversable instances. Switched to use Data.Foldable functions where possible.