Fixed hamming distance function

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