Progress on #111

Refactor the old check_public_key/has_public_key system and consolidate.  Also make the function applicable to testing private keys