Implement __eq__ and __ne__ in the base class directly

This closes #19 by making the equality checks uniform across all classes.
Merge pull request #22 from olasd/bugfix/careful-equality

Implement __eq__ and __ne__ in the base class directly