The prototype of the MICE Electron―Muon Ranger: Design, construction and test