Signature verification, fix keypair constructor, cleanup.

As far as I can see, this is not idempotent.