Writer fixes

Changed the way quoting works to be more standard. There is a performance hit, but it seemed a worthwhile tradeoff for correctness. Also changed the default line separator to be the system standard rather than \r\n.

If you want me to remove the ruby support commit out I can, but I don't think there is much value in supporting <1.9.