[REF] towards cleanup of update membership code
This PR limits itself to siphoning off how the memberships are fetched & having that function
- return as an array of arrays rather than an array of objects
- index the array by id rather than membership type
This is a step towards the changes in https://github.com/civicrm/civicrm-core/pull/12542
& it should allow a separation of concerns relating to the LOADING of memberships from the
processing.
I note that the PR I'm looking at changes what gets loaded & that should be it's own PR
but also that there is an extraneous if() here - I didn't alter that because
it is a big white space change & doing on it's own will make that easy to review