This script was defining an operator within the panels draw function, while its possible to support this its really asking for trouble. the fix is to raise an error when this happens. also fix crash passing non classes to register_class/unregister_class