Somerset Development has completed the sale of 15 acres in downtown Somerville to AvalonBay Communities Inc., paving the way for the construction of 374 apartments and other uses that will anchor a long-awaited redevelopment project.