Refine class defines.

setClassName change to registerClass
extend will not registerClass