Per server rate limit

Rebased on from master. See #5.