configs write in binary mode AND are encoded in the event of unicode

After pulling in [MichaelHipps](https://github.com/MichaelHipp) proposed changes, I worked to get the unit tests passing on *nix at least, and that necessitated an additional change to how we write things out (need to encode the string that we're writing to file)