CreateCatTable changed to handle ordered factors.