The main reason for doing this is to make a common interface for MasterWebUI and HistoryServer to attach SparkUI's without each having to re-implement the logic themselves.

In the future, when we want to extend SparkUI to include other tabs (e.g. Streaming), this will be more necessary. An example of that is in this [sub-PR](https://github.com/tdas/spark/pull/2).