Make YAML parsing work with Ruby < 1.9.3

Ruby YAML parsing is different after 1.9.3. Made it behave like 1.8.x so
that we can have consistent handling of custom types.