Automatic keygen

Fixes #303.

I don't think it's possible to write a reliable test for this. But I did change the entropy threshold from 2400 to 5000 to test it, and it indeed reverts back to "flag to reply" like it's supposed to. If entropy is low, it shouldn't continue generating keys.