Critical transaction fix

Fixed a little bug that made it impossible for the xpt pool server to
generate valid blocks that contain non-coinbase transactions.
Interrupt on new work

The miner now stops processing the current work when a new block
appears.
Better transaction handling
Merge with jh00 master
Merge with jh00/master