Renamed all "fail" variables to "err", to reduce line lengths.
Added explanatory comments to readwrite library.
More comments on readwrite library; some refactoring ideas included.
Use "uint8_t" instead of "unsigned char".