Merge master into MSVC build

Paul, I needed a base merge of MSVC_build and master from which to start the WinIOCP refactor branch, so I have hand merged MSVC_build from just before you started your VS2010 changes with master, plus cherry picking a few bits from later on in MSVC_build. If you merge this into your MSVC_build, it should be much easier for you to merge MSVC_build back into master later.