reduced the size of class flag numbers and moved them from bg_misc.h to bg_classes.h