It sounds like you have a couple of different problems!
The first is your battery & the charging logic is likely in bad shape. Lets run this app so we can see things more clearly CoconutBattery Lets get a snapshot of the main window with the MagSafe connected. Post it here for us to see Adding images to an existing question
The racing fan is the SMC trying to manage an overheating condition, at least thats what SMC thinks. This could be caused by liquid damage or a failed sensor. To investigate this weill need to us a different App TG Pro is what I would use as it allows us to see things more clearly. Again, take a snapshot of the main window showing all of the sensors (you may need to grow the window) and past it here for us to see.
Lastly, physical inspection to see if any corrosion or dust build up needs to be cleaned up. Get a small soft pain brush and a can of can’ed air so you can scrub down the dusty parts and us the can’ed air to blow the debris off. Given the systems age you should clean off the old thermal paste and apply fresh paste. So here’s the guide to fully remove the logic board to inspect it (both sides) MacBook Unibody Model A1278 Logic Board Replacement and here’s the info on the thermal paste How to Apply Thermal Paste
crwdns2934105:0crwdne2934105:0
crwdns2934113:0crwdne2934113:0
crwdns2915270:0crwdne2915270:0
crwdns2889612:0crwdne2889612:0
0