restructure application so that it can be used in geonode

Put more functionality into the salamati.Viewer class, and initialise the viewer in the index.html instead