update function for cascaded deletion of member records

- add indices to greatly speed up deletion (still too slow, though)
- also delete chat messages
- fix problem with the deletion of direct messages