Added rudimentary logging capability.
Added support for writing.