Detecting selection in population trees: the Lewontin and Krakauer test extended.