Fix serialization of domain with superclass

Contains corresponding tests.

I don't know if testing if _field_ is _null_ and throw a NoSuchFieldException is the correct way of doing things.