[SPARK-2298] Encode stage attempt in SparkListener & UI.

This turned out to be much tricker than I thought. It is still work in progress, since failed stages don't get reported properly yet. Also probably fails the JSON protocol test since I didn't update the protocol.



Do you think the 0-indexed nature of this is going to throw people off -- since they'll see "Stage X" and "Stage X (attempt 1)"?