We present a new Bayesian method for estimating demographic and phylogenetic history using population genomic data. Several key innovations are introduced that allow the study of diverse models within an Isolation with Migration framework. For the Markov chain Monte Carlo (MCMC) phase of the analysis, we use a reduced state space, consisting of simple coalescent trees without migration paths, and a simple importance sampling distribution without demography. Migration paths are analytically integrated using a Markov chain as a representation of genealogy. The new method is scalable to a large number of loci with excellent MCMC mixing properties. Once obtained, a single sample of trees is used to calculate the joint posterior density for model parameters under multiple diverse demographic models, without having to repeat MCMC runs. As implemented in the computer program MIST, we demonstrate the accuracy, scalability and other advantages of the new method using simulated data and DNA sequences of two common chimpanzee subspecies: Pan troglodytes troglodytes (P. t.) and P. t. verus.