Adding some equality rules

This required refactoring a bit of the conversion between
datatypes, since that conversion is potentially shared across
In and Eq (and eventually Lte, Gte, Lt, Gt, etc)