new data type for qualities

Introduced arithmetic on 'Qual' and the new 'DQual'.  Makes a lot of
stuff more pretty and easier to understand.