Add a rate limiter, use it to rate limit docker pulls.

I added more documentation.  I think that you can implement it as you suggest, but there are all kinds of edge cases due to rounding at low QPS...