Added public_key_fn and made both private_key_fn and public_key_fn async. Closes #4.