Except for code using ed25519-dalek, since we are blocked by them.
Also tweak RNG source so only key generation uses `OsRng`. PoW nonce
generation only need unpredictability thus `ThreadRng` suffices.
See: https://github.com/dalek-cryptography/curve25519-dalek/issues/731
We may allow more challenge types other than PoW in the future, eg.
captcha. So make the relevent types more generic.
Now the challenge is returned in JSON response as a individual top-level
field `register_challenge` instead of in HTTP headers.