Add serialization, equals methods and more tests