Backport Hash select/reject fixes for ruby 2.2 from Rails 4

https://github.com/rails/rails/pull/14198
Merge pull request #1 from kongregate/3-2-ruby-2.2-support

Backport Hash select/reject fixes for ruby 2.2 from Rails 4