[SPARK-2261] Make event logger use a single file.

Currently the event logger uses a directory and several files to
describe an app's event log, all but one of which are empty. This
is not very HDFS-friendly, since creating lots of nodes in HDFS
(especially when they don't contain any data) is frowned upon due
to the node metadata being kept in the NameNode's memory.

Instead, add a header section to the event log file that contains metadata
needed to read the events. This metadata includes things like the Spark
version (for future code that may need it for backwards compatibility) and
the compression codec used for the event data.

With the new approach, aside from reducing the load on the NN, there's
also a lot less remote calls needed when reading the log directory.
The change is sort of necessary because of the way I decoupled EventLoggingListener and ReplayListenerBus. Now opening the log and replaying the log are different things, since the log can come from different places and may have to be pre-processed.

I agree returning the listener is a little weird (although I wasn't too converned about it in a private API). I changed it slightly at the cost of some redundant work, let's see if you prefer that.