Dynamically define methods instead of using method_missing.

Just an alternative implementation, using define_method.