Report application start/end times to HistoryServer

This involves adding application start and end events. This also
allows us to record the actual app name instead of simply using
the name of the directory.