Implement equality and hashcode in IndexedValue