simplify removeMemberships function

remove lots of the callback cruft
move inline memberships code to separate file

reduces the size of the app file which should make it a bit more
readable