Add binary tests

Fix copy/paste errors in cmp_write_bin8.
Add test for cmp_write_bin convenience method