Corrected boolean to int conversion typo.
Got the existing unit tests back to a passing point.
Fixed a bunch of reader and writer bugs.
Moved unit tests bytes comarison to its own util helper.
Ported the slices unit test from C++.