SPARK-2150: Provide direct link to finished application UI in yarn resource manager UI

1. Simplified the way history url is passed to the AM in yarn client mode.
2. Consolidated code for constructing the history address in a util class.