Input selection algorithm

Rebased to vp-withdrawal.

Note I had to make some minor changes to make the test run again.

Also the createInputs and createInputsStore needs to be cleaned up. They are both taking a store right now and especially the createInputsStore name is misleading.
It's a bit annoying that we use currentBlockHeight in a bunch of places and chainHeight in a bunch of others. We should pick just one (I'd prefer chainHeight as it's what is used in Credit.Confirmed) and use it consistently.