Feature/spark custom metrics

This is PR is against feature/spark-metrics which is almost in final stage of review here: https://github.com/caskdata/cdap/pull/672

I will merge the earlier one and this to release as the reviews are completed. Will merge https://github.com/caskdata/cdap/pull/672 and this one after review.

Opening it out now so that its out there for review.

Also, I have included a small change as a separate commit in SparkPageRank example which emits custom metrics. Ideally, it should have been in different PR but the time crunch needs it :) Apologizes. 


@anew : Please review. Thanks. 
does this need a separate PR? You already changed the app to emit a user metric. Can you add the assert() to verify that here?