A simple function for comparing two objects for equality