Fixed bugs when compiling with c++11 and added another test.

Changed the synchronization method futures and boost::async
to using thread_groups and barriers instead. This no longer
requires BOOST_THREAD_VERSION=4.