Refactored Model.define so the model constructor is available in `define` event