added code to handle delete of user. added code to assign groups to user
on update or insert.