added saving true type, e.g. Object[] keeps types. Compacted writing
classname so each only gets written once.