Define `__eq__` method for Compound

Compound objects are considered equal if their JSON records match exactly.