Add tests
Turns out adding new features/modifying this library has become quite time-consuming. Mostly because the client makes various caching guarantees depending on counting strategies and the order of operations.
Automatically testing those will likely save quite some time in the future. It also spells out these guarantees for anyone who isn't familiar with the inner workings of the client. That might help in using the client more efficiently.