use mkdir -p to remove warning on exists
log to a local var/ directory in the project structure by default
log to stderr if logging to a file fails
use local node binary if present, global otherwise
log stderr and stdout to files even though they shouldn't be used
put appstate file in local var dir, not /tmp
just call function instead of nextTick