add wrapper for boost::mt19937 mersenne twister rng

The class mt_rng is a wrapper which provides a similar interface to
this boost rng class as we had to the linear congruential rng
implemented in simple_rng. This commit creates mt_rng.hpp and
mt_rng.cpp and adds them to SConscript and CMakeLists.

This commit also adds the boost::random depenency to SConstruct.
I mark the required version at 1.43.0.

I also am forced to add an implementation of the "discard" rng
function, which seems be available on my machine but not in the
travis build environment.

Also, add preprocessor flags for no boost::random_device

If we don't have boost::random_device available on target
platform, then leaving the flag undefined will cause us
to use the ctime system time to get seeds.
switch over gamestatus and sync code to use mt_rng

In places where previously simple_rng was being used.
This may require fixup, as we are casting uint32's from
the rng to ints.
add mt_rng to server for seeding mp games

The server holds an mt_rng for every game, which it uses to
generate random seeds which are sent to the clients. This way
there is only one code path to boost::mt19937 and
boost::random_device.

TODO: It looks like this will still cast all uint32's from the rng
to ints before sending them to the clients, unclear if that causes
problems.
never cast random results from uint32_t to int

throughout the random wrappers and the code that uses them, make
sure to replace int's with uint32_t's.

it would be better to use boost distribution objections perhaps,
than modding rng results as we currently do.
store random_seed in cfg by lexical cast uint32_t <-> std::string

This commit changes the way seed info is handled by the server,
clients, and cfgs, to prevent silent conversion between int
types. In this version there is the drawback that rng construction,
and therefore game_state construction (!) can now throw a bad
lexical cast. This commit should be amended in the future to deal
with this appropriately.
add seed_rng namespace and files

In order to separate the "seed source" objects from the actual
PRG objects, this adds a new file and name space "seed_rng" which
can be used by rng's which are constructed without a seed.

The implementation has preprocessor guards, and should be either
boost::random_device or just the system time if that is
unavailable.

Since it goes on server as well this file also needs to be in
wesnoth-core.
require random 1.40.0 only, use ctime if WIN32 && boost_v < 1.43.0

Fixup seed_rng to check for windows and boost version < 1.43.0.
This allows to downgrade boost random lib requirement to 1.40.0.
add std::string versions of seed, get_seed to mt_rng
use stringstream to get seeds from configs, not lexical cast

Also, get seed values for configs from the get_random_seed_str
function.

We don't otherwise mess with the types of synced_context etc.
The basic types of those objects, seed_generator etc. is the
same except that int -> uint32_t.

Fixes up commit cdefb9c98e8517c5c2b532970fdaf22d8c1b73de
refactor synced context to use std::string, not int, for seeds

This allows to mark the "seed" function of mt_rng which takes
a uint32_t as private, leaving only the std::string option
public.

With this change it should be completely unknown to the engine
that the mt rng internally uses uint32_t, only the wrapper class
should know this. There will still be some stringstream ops on
the server-side though, to map uint32_t rng results to hex strs.
add unit tests for rng

The tests validate only a small part of the functionality:

- boost::mt19937 with default seed gives a particular long int as
its 10,000'th query, specified by boost
- rand_rng::mt_rng class properly transforms seeds from uint32_t
to std::string in hex notation and back
add next_seed_str to seed_rng, and use in synced_context

This commit moves some of the stringstream manipulations of seeds
into the seed_rng namespace and thus out of the rest of the engine.
add rng reproduction unit tests and fixup ctor, discard

This commit adds some unit tests which test reproducibility of the
rng from the info that we store in configs.

The unit tests do things like, construct an rng in any of several
ways, use it a bit, get its state to a config, construct a 2nd rng
and test that these have equal state / give equal random draws.

The code fixups are to be more disciplined about using the
random_calls_ variable, initializing to zero and always setting
using the seed function. The discard function now uses
get_next_random rather than mt_(), so that it atomically counts
the number of random calls.
mt_rng extends the boost uniform rng concept
random_new and derived now impl boost uniform rng concept

This means they can be used as arguments to boost distributions,
without messing up the random_calls count.

http://www.boost.org/doc/libs/1_55_0/doc/html/boost_random/reference.html#boost_random.reference.concepts.uniform_random_number_generator
use boost::uniform_smallint for attacks, traits, genders

Using a boost distribution ensures that random sampling will be done
accurately on all platforms with less room for error from us.
add coverage unit tests

I wanted to make sure that even when the seed corresponds to a hex
string with leading 0s and no letters, these won't be truncated by
the config object. This unit test tests a variety of such strings
and similar.
Test sending rng seeds over the network

This test makes a series of configs which look like rng seed updates,
sends them using the network layer, and recieves them, and checks the
integrity. It includes hex strings which are all numeric and begin
with leading zeros, to be sure that the leading zeros are not
truncated. The list of seeds is duplicated from part of test_rng.cpp.