Fix define_singleton_method to set methods on the metaclass. Fixes #40

This was previously setting the singleton method on the current class's
class, which ended up being either Class or Object. This had the
unintended side effect of putting the singleton method on ALL objects.
After looking into how Ruby handles `module_function` I found out it
uses rb_singleton_class instead of rb_class_of. Switching to that fixed
the bug.