Add cryptographically secure random number generator

Supports Windows and Posix

Tested on Windows and Linux, but should work also on OS X and FreeBSD.