Add rate limiting for init and verification.

Generalizes the ratelimit code used in server, and applies it to ivs. And when I say "generalize", I mean move some functions into another module :smile: