Split up long line for getting the exit code (dimitern's review)

 * Add comments
Use an AttemptStrategy instead of hand-rolling one (Tim's review)

 * Fix up comment