A Distributed Framework for Smart Grid Modelling Monitoring and Control