Issue #103: sort mempool

Make the mempool transactions sort by dependency
Change history to also use the same dependency sort (toposort)
Change get_mempool_txs to return transactions, not just their hashes