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