refactor creation of membership_payment records into shared function
refactor out createOrRenewMembership function
share create membership function & move compiling errors into a separate function
Merge pull request #3370 from eileenmcnaughton/CRM-14197

CRM-14197 refactor out smaller functions