Distributed Software Infrastructure for General Purpose Services in Smart Grid