Coordination of Active and Reactive Distributed Resources in a Smart Grid