An Adaptive Independence Sampler MCMC Algorithm for Bayesian Inferences of Functions