Problem with engine fan on a 02' Ford Escort SE 2.0L FI SOHC 4cyl?

Once the fan starts up it will not stop even with the motor off unless I turn the key to the on position and, after a few second, turn the key back to off. I have to remove my battery cables when not running the car or it will end up dead which I'm not sure if the fan is kicking on at times without the key turned on or if it is a separate problem. The fan will also start and stop 5-6 times really fast (like it's gearing up) and then begins to run normal when putting the battery cables back on. It also starts up as soon as I turn the heat on any setting. This causes the heater to blow cool air after 10-20 seconds or so. The dash heat gauge works, I already replaced the thermostat, replaced & topped off the coolant, and checked the heater core (it was good). Could this be a bad coolant temperature sensor or is there another one for the engine/radiator fan?

Added (1). The CCRM, where the hi & low fan speed relays are located, works fine as it switches between speeds depending on how cold the motor is running.

Added (2). Would the CCRM fan relays effect the temperature of the heated air blowing out of the vents? Even with a heated motor the air becomes cool in less than a minute on any heat vent setting. Also, I just found out that the a/c lines are getting very cold when the heater is on in every vent setting, too.

Added (3). I should also add that the gauge shows the car running at normal temperature and when I turn the heater on, the fan kicks in, and the temp gauge slowly starts dropping. Within 10-15 minutes of running 70mph the needle is setting at 1/6-1/8 of the way up on the gauge.

Time for an appointment with the car doctor… There's a relay in the fan circuitry, and sounds like it's dying. BUT! It's an easy plug-in-plug-out fix.

The temperature sensor for the fan is faulty. Look for s thing with 2 wires coming out of it attached to your radiator, this is probably what is faulty. Another way you can do it is change the wires on the fan, so the fan only comes on when the ignition is on