Signature verification, fix keypair constructor, cleanup.

I'm a bit uneasy about all these free functions in the plain "dev" namespace.