Updates to extensions API - still early stages.

Still early stages, updated the extensions API, update media folder with
the relevant files. Added event emitter helper. Also made JHtmlCosmic
with a method that will help render the view which is called in the
CosmicView::display method.