Call define_method using send, instead of directly (fixes 1.9.3 compatibility)

Looks like this bug was fixed in Ruby 2, but I am using 1.9.3.

Works around https://bugs.ruby-lang.org/issues/8284
Makes tests pass on 1.9.3.