Move most of txToPairs into a new createTx func

Also changes it so that it adds new inputs incrementally as needed instead
of starting with an empty tx and adding all inputs again on each iteration.
I find this confusing to read.  `change` here is shadowing the variable declared just outside of the `if` beginning on line 197, which checks that `change > 0`, so it reads funny that both of these if statements could be false, and at this point change is negative.

Instead, I'd use a for like a C while loop and do:

```Go
for totalAdded < minAmount+minFee {
```

and just keep iterating until enough inputs have been added.  Then in the outside for loop, check if the input amount exceeds the output+fee, and then add a change output.