Remove use of Enumerable#each_with_object

This method does not exist in Ruby 1.8.7.