Applying unit test and fix for #LANG-292. Also fixes a couple of problems with the unescape(Writer..) overload that came up