Add rate limiting stuff.

Largely untested, if I broke anything, @aji will yell at me! :P