added test script to write to log and stdout
revised example script
reworking timeout and spawing code