Extract rate limiter as its own module, with middleware on top