Block execution of main until after window connect
Differentiate stdout and stderr
Use crypto.getRandomValues for /dev/urandom