Scalable Bayesian Matrix and Tensor Factorization for Discrete Data