Major overhaul. Better handling of strings in factor values and of factors with large range of values.