Identification of haplotype blocks using character-compatibility analysis and inference of deep human history