Fixed hamming chunk encoding and decoding

Changed it to work with chunks of 3 instead of 2, and completely rewrote
the encoding and decoding process and verified they work.