Replacing some poorly-supported C++11 features with their boost equivalents.

thread_local requires g++-4.8's runtime, using boost::thread_specific_ptr instead.
Replacing std::to_string with boost::lexical_cast<std::string>