CDAP-652: updated Spark job UI to display the collected metrics in blocks

We are referencing three level deep inside the object. What happens if one of the first two levels, in the worst case becomes ```undefined``` or ```null``` (```result[i] or result[i]['result']``` is ```null```)? A little bit of check before accessing the third level could avoid js errors.