Improved defineClass.

Inheritance of static members had some shortcomings.