Add __eq__ and basic reading/writing unit tests