Improved and Generalized Upper Bounds on the Complexity of Policy Iteration