Support arithmetic on Gray. Fixes #178