A novel architecture for the optimal control and management of electricity distribution systems