Analyzing single-molecule time series via nonparametric Bayesian inference