runner.rb: limited retries and print exact error.
runner.rb: looks better and you can pass the argument
history.rb: File.write
runner.rb: only retry if the shell is still running