Selectively use type_traits and random

if C++11 is available
then use C++11
else if BOOST is available
then use BOOST
else
use TR1