For the categories use two server behaivors:
1) DELETE all of the rows associated with the product being updated. That can be done with the standard delete server behavior.
2) INSERT all of the categories selected in the select list. You can use the standard insert server behavior and then manually wrap it in a loop to loop through all of the selected categories.