Added support for rate limiting

Currently returns status 429 when the limit is hit.  I'm not sure if
this is a real HTTP status code, but I think it's at least a proposed
one.

Also made sure that we lock the command before we execute it (so that we
    don't run the same command twice on accident and skip over the rate
    limiting)