added indexes, and fixed crashing error

Indexes speed things up noticeably. I also discovered that bitcoind cannot
handle rapidly successive RPC calls, so I have created code to throttle RPC
commands sent to bitcoind.

I have also noticed that my code seems to crash on this block:
000000000085240735aaca9c00d6fb637a507127713ba4de214b2532288b5d2a
This is still unfixed.