Fixed hamming distance functio

* now correctly computes hamming distance
* added a stringToBytes() function to convert string
  to byte arrays which are easier to work with