Chromosome inversions, adaptive cassettes and the evolution of species' ranges