Better random seeding using gettimeofday
Don't allow connect primary output directly to primary input
Improved logging + lots of minor changes