more robust init, importPrivateKey, toJson