Simon
There are two temperature sending units in your car, find them. One could be labled as a temp switch, fan switch, or whatever the hell they decided to name it. I have seen those sensors on the coolant return from the radiator, down on the bottom of the engine block, it could be anywhere, you gotta hunt for it.
Also look for a BAD GROUNDS, from battery to chassis to engine to dash. After you said that it started running better and then the cooling fan quit, I would really start looking for BAD GROUNDS! Most sensors rely on chassis/engine ground and 5VDC from the ECM to send their signal back to the ECM in a voltage range that it can understand. It is also possible that you have a short to ground or a heavy current draw on that 5VDC line from the ECM. That will create all sorts of strange behavior that is hard to track down. A sensor that is leaky or intermittently shorting to ground or opening up putting 5VDC on the sense line back to the ECU could keep it from knowing when to turn on the engine fan.
Check ALL fuses and links with an ohmmeter to insure that they are not blown. Please don't trust any schematic, manual or diagram, they are likely all wrong. Verify by chasing the harness to the very end connectors and make sure there is no pinches, chafing, burns or missing insulation. Change out the cooling fan relay for a known good one, never trust, verify operation or replace it. Automotive environmental conditions are hell on electronics as you know.
Good luck...
Chris