Abstract binary-hex conversion for eventual Python 3 port.
Test out-of-order bug in _populate_block_txin.
Fix out-of-order bug in _populate_block_txin.