Define equality, equivalency and hash methods automatically