Implement splitLastOutput and hook it with the case where we don't have enough inputs and have to split an output and fulfil just part of it.

The other case where we need to split an output is when the tx is too big, and that's coming in my next PR.
I guess this should be the tx.outputs[lastaddedoutput] instead. Same goes for the comment above.