add get_class_for function + unit tests

@stdweird: for EasyTest, please review
no EB examples please