A Novel Population Genomic Method For Inferring Population History And Detecting Adaptive Genetic Variation