Bicycle cable ends are available from you local bike shop, and online. They crimp on to prevent the cable end from fraying. I prefer using a plastic bead, like the kind associated with Mardi Gras. Tools & supplies: Plastic beads, small butane torch (a butane lighter will do in a pinch), good wire cutter (preferably a bicycle specific one). 1. cut cable, so end is not frayed. 2. heat end of cable till it turns red. 3. slide/ melt the bead on.
The CAUTION in step 13, "Make sure to pry up from beneath the wires and not underneath the socket," applies to this step as well, for removal of the fan wires.