Make most lending changes to Pyberry

All changes from old lending (branch lending old) have been incorporated.