fix lack of rigor in keyPair, now almost identical to redback
Merge pull request #7 from redtrine/fix-keyPair

[KeyPair] Several fixes and improvements.