Allow use with Ruby 1.8.x

Ruby 1.8 doesn't have #each_with_object on Enumerable.

Using #inject instead.
Merge pull request #12 from ozzyaaron/patch-1

Allow use with Ruby 1.8.x