no need to fetch block in prev_txs for SequelStore

in wrap_tx blk_id is assigned only if block is in the main chain
more prev_txs cleanup

* for UtxoStore blk_id is always a block on the main chain
* for sequel store it stays the same as it was
* dummy only seems to care about the main chain
* for other storesi (to come) we assume blk_id will always be a block in the main
chain, which seems fair given Tx model only keeps association with one
block
fetch existing tx ids when storing block in one query instead of N
do one query instead of N to fetch existing addr ids
use copy_into for postgres inserts where it's simple enough
use COPY to store addr and tx for postgres
use COPY for massive inserts with postgres + cleanup
fetch all prev_txs needed for validation with a single query
optimize finding spent outputs
cache tx binary hash

This gets called *a lot*. To my surprise there is actually measurable
improvement in block store time with this.
let's not recalculate hashes for objects fetched from db

We have check consistency for that.
Comparison "blk.hash == blk.recalc_block_hash" in consistency check
would even suggest that blk.hash is expected to be fetched from the db
fix some old typo preventing script cache
cleanup script naming in txout
fix test failing on ruby 2.0

We are only adding @addr in before, so expectation wasn't matching for
newly generated key, I still have no idea why it wasn't failing on 1.9
let transaction tests also run on dummy store

+ add get_idx_from_tx_hash for dummy store
+ support looking for hash160 among multisig outputs
+ use store_tx instead of store_txout in test
  (perhaps store_txout/txin should be protected methods?)
add test for get_txout_for_txin and dummy store implementation
rescue all errors from command handler
new checkpoints
distinguish disconnect from failed connection in log messages
fix handling incoming connections by node