delete an object's memberships when it is deleted

use the post middleware hook to remove memberships that an object has
when it's removed and then fire an event on that object in case we need
to know ( which we do for the tests to work ). In order for this to work
we need to do the membership deleting via async so we know when all the
membership remove calls have completed