added support for serialization of classes without parameterless constructor