Stochastic Dynamic Programming and the Control of Queueing Systems