Java port of RateLimit from chriso/redback node.js library.