empty_level function

Convert categorical variables to factors and deal with empty/missing values