Implement __eq__ and __ne__ in the base class directly

This closes #19 by making the equality checks uniform across all classes.