implement Ord, TotalEq and TotalOrd for char

Closes #6063