tests: remove unused variables
TxBuilder: extract ExtractSignatures to free function
TxBuilder: re-order to avoid mutation in case of failure
TxBuilder: sign now signs inputs in known publicKey order