Latest changes for the lib.
Added support for writing bytes as well as strings.