Fix double loop on lineItems
Historically the code followed 2 loops - one for the (very rare) situation when an array of
'line_item' was passed in - in fact this array is an array of arrays where each array represents
the id of a line item and the amount to allocate.
The other loop is the main loop that allocates according to a calculation.
This fixes it so that the allocation is correctly merged in if passed in in
getPayableLineItems and from that point we only need one loop.
This simplification is tested via the testCreatePaymentLineItems
which I cleaned up and made more robust. I was able to step through it and identify how
it was working