shifts algorithms to be abstract, added Mersenne Twister algorithm.