[SPARK-1768] History server enhancements.

Two improvements to the history server:

- Separate the HTTP handling from history fetching, so that it's easy to add
  new backends later (thinking about SPARK-1537 in the long run)

- Avoid loading all UIs in memory. Do lazy loading instead, keeping a few in
  memory for faster access. This allows the app limit to go away, since holding
  just the listing in memory shouldn't be too expensive unless the user has millions
  of completed apps in the history (at which point I'd expect other issues to arise
  aside from history server memory usage, such as FileSystem.listStatus()
  starting to become ridiculously expensive).

I also fixed a few minor things along the way which aren't really worth mentioning.
I also removed the app's log path from the UI since that information may not even
exist depending on which backend is used (even though there is only one now).
The problem is that what you suggest is just not possible, because you need to replay bus to be instantiated before the UI, and replayed after the UI is instantiated.

So you have 3 options:
- duplicate the code, which I don't like
- my approach, which is ugly but my least hated of all the options
- break things down into even more methods:
  * one to instantiate the bus
  * one to replay the bus
  * one for building the UI, one for building just the info, both of which call the two above.

The last approach, which is the closes to what you suggest above, would have more noise (method declarations et al) than actual code.

The *real* fix would be to fix the SparkUI signature so that it makes sense (e,.g. make it act like a proper listener instead of doing what it currently does), but that's way beyond the scope of this patch.