Changed MediaFiles to access media types by key.
Added event tracking.