12.04 fixes

Several changes for  backwards compatibility. Caveat: The code doesn't work yet. I am certain about all but the last three commits. The last three are the best I could do to fix a wart in the C++11 implementation in g++-4.6 which forbids thread arguments from being move constructible. They need to be copy constructible for us to pass them as a thread argument, and class Socket isn't.

Maybe @keithw will have better luck fixing these issues.