All of the res/ stuff (other than res_jabber) from the RSW branch.