Pull out event system so it can be shared

Extract the event emitter code so it can be shared by media sources and source buffers. Update video.js dependencies location. Invoke `endOfStream` on the SWF object when `endOfStream` is called on the media source.