cleanup/cosmetic

use a plain random nonce instead of hashing the time
replace module imports with function imports
change default work factor
eliminate some magic numbers