Use a metaclass to emulate define_singleton method in ruby 1.8.7