Fix-up random seeds: consistency and unit tests

All random seeds are now checked (and only checked) by misc._check_seed,
which now also allows for np.random.RandomState objects.

Permutations of samples should now be determined by the seed given
to model.sampler, not the np.random global state.

There are now unit tests for misc._check_seed and to verify that the
model output is exactly reproduced, given the same seed.