Replacing an each with reduce

The functionality has not changed, but the code is more elegant by
using `reduce` instead of `each`.

This way no accumulator is declared, no explicit return is
needed.
Nice! Can collapse a bit further with `each_with_object`:
```ruby
messages.each_with_object({}) do |(attr, array), by_attr|
  by_attr[attr] = array.map { |message| full_message attr, message }
end
```