Reduce boost namespace pollution

Should fix #3483, as well as being a good practice in general. The second commit changes a bit of code, so it's not lumped in with the rest. The others should be semantic changes only.

After this, there are only 2 users of "using namespace boost::foo" left, and those were left in because they're very wordy otherwise.