more powerful serialize() - user defined streams, pretty-printing, simplifiers