Replace Kernel#define_type with Type.define_new
Improve test methods