Change in iotDashboard js structure

Changed the structure of the iotDashboard using the prototype directive