Add `__eq__` and `__ne__` and DRY tests