A Massachusetts rebate program to encourage small renewable energy projects has, in its first year and a half, awarded nearly $4 million to 400 homes and businesses—fueling a trend toward energy independence that is becoming increasingly common in the region.