cleaned up api.py, util.py, counterparty.py; DB cursor passing; etc.
minor bugs
colouring tweaks
fixed sqlite3 locking/memory error; rounding error