Create Cointools.py

Some of my code, some of Vitalik Buterin's code.