Design and construction of the MicroBooNE detector