Simulation-based Bayesian analysis for multiple changepoints