Fixed objstream/stream read bug, fixed pdfwriter re-ref algorithm

Fixed stream object when stream is follow by a single LR/CR, a lot of hack
Fixed writer, new ref generator now traverse depth first, means leaf nodes always de-referenced first.