Python 3 compatible port of Python 2 random module
