more readerwriter tests - also cleans up writer.ml

all 691 tests pass :)