Major refactor and addition of TxQueryResult.