defn/defs need scope to get proper rubyClass for definition.

Fixes #1239