update gemfile with rspec and regrouping
replace to_h function for backwards compatibility to ruby 1.9