Replace to_h method with own hashifier in order to work with Ruby 1.9.3 as well