Adding some Eq instances and hlint suggestions

Not having Eq available is annoying when the library datatypes are used
in other data structures which need to derive Eq, for example because
they appear in HUnit test comparisons.
Avoid use of 'error'

Switch to Either instead (already using it in most places anyway).