Add votingpool credit interface and test sorting algorithm

Add the CreditInterface interface type which facilitates mocking and
thereby making it easy to test the sorting algorithm.