Use extended Euclidean algorithm for modular inverse

This roughly doubles the speed of the ed25519 implementation in Python.

For whatever reason, this is faster than the previous squaring method.

Before:

<pre>
Time generate
2.8231959343

Time create signature
5.24891996384

Time verify signature
7.75262784958
</pre>

After:
<pre>
Time generate
1.58998298645

Time create signature
3.2284090519

Time verify signature
4.52029514313
</pre>