ecdsa RFC 6979 amendments

This pull request just changes `deterministicGenerateK` to strictly adhere to the RFC rather than just step around the edge cases.

Namely it avoids the following flaw in the current implementation:
> Please note that when k is generated from T, the result of bits2int is compared to q, not reduced modulo q. If the value is not between 1 and q-1, the process loops. 
> Performing a simple modular reduction would induce biases that would be detrimental to signature security.

This is not a critical problem, it is just adhering to the spec more clearly to avoid any possible complications.