[WIP] Refactor and test crypto_util. Wrap pyelliptic.

I am posting this so that no-one else wastes time doing the same task. Please don't review yet, I 'd like to simplify the code and add a couple of tests.