function getDirection(key, critbit) {
  var byteIndex = critbit >> 8;

  if (byteIndex > key.length - 1)
    return 0;

  var byte = key.charCodeAt(byteIndex),
      mask = critbit & 0xff;

  return (1 + (byte | mask)) >> 8;
}
Helper returning the direction we need to take given a key and an
encoded critbit.

@param  {string} key     - Target key.
@param  {number} critbit - Packed address of byte + mask.
@return {number}         - 0, left or 1, right.