implemented a unit test of basic KeyGenService functionality, fixed a bug in the timing of pool refreshes