Bayesim: a tool for adaptive grid model fitting with Bayesian inference