In P3, can only append integers to bytearray, not bytes, also fix some byte/string comparisons & encoding crap
d3154e0ef4