Maintain 1.8 compatibility

* Object#singleton_class only became available in ruby 1.9.2, so we need
  this to backwards compatibility