Cashtab transaction functions are overloaded and complex. They are all in the utils/ directory, with all of the other Cashtab functions.
Cashtab should have better organized functions and unit tests.
This diff starts improving Cashtab's transaction building functions by creating a new function sendXecToOneAddress. This is currently handled by sendXec, which also sends xec to many addresses, sends OP_RETURN msgs, sends encrypted msgs, and sends those to many addresses as well if it comes to that.
This function implements the new coinSelect function from ecash-coinselect to bring transaction fees down to 1 satoshi per byte (or ~1.01 satoshis/byte for txs sent to P2SH addresses).
A new supporting function signInputs is also introduced, as the existing signUtxosByAddress function returns TransactionBuilder. This is not necessary as TransactionBuilder is an object. However, it is done this way in existing transaction functions, many unit tests are there for it, and it would be a lot of makework to remove it from the existing transaction building functions that I would like to deprecate anyway. So -- new function.
Note: this diff does not implement the function anywhere in Cashtab. user-facing behavior is not impacted by this diff.