Design and Construction of the BESIII Detector