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.
Agreed. I never liked the chainHeight, but the inconsistency is worse. Further currentBlockHeight is really long. I'll change everything to chainHeight instead.