add class_weight to trees, expand tests & minor refactor