A Hierarchical Framework for Phylogenetic and Ancestral Genome Reconstruction on Whole Genome Data