Signature verification, fix keypair constructor, cleanup.

This looks like functional style to me. If we write a wrapper, it would perhaps be a good idea to create a signer class which requires a Secret for the constructor and calls this function in the constructor. On the other hand: I don't really know the direction this will go.