Add an option to automatically obey rate limits

This is done by checking whether the number of remaining requests we
have according to previous rate limit header responses is >5% of the
total number of requests per hour we are allowed, and if the client is
below that number, it will wait a short amount of time until issuing the
API request.

This is not fully threadsafe and may produce surprising results if two
identically-configured clients are making requests at the same time,
consuming the same quota pool. The 5% soft threshold is intended to
alleviate some of this, but it can still be fooled by a determined user.

This is only intended as a convenience to users, not as a guarantee that
rate limits won't be hit while using this option.

This also adds a test that checks that requests against a
rate-limit-enforcing server succeed with the option on and fail with it
off.