1. For the heat you want to get rid of the Apple Thermal and the one that freezes most systems the AppleIntelCPUManagement.kext. Once you have replaced/removed .kext's then you need to typing in your password set on install after the sudo command in Terminal.
Code:
sudo -s
diskutil repairPermissions /
rm -r /Volumes/username/System/Library/Extensions/Caches
rm -r /Volumes/username/System/Library/Caches
rm /Volumes/username/System/Library/Extensions.mkext
Replacing the username with the one you use once you reboot you need to hit the F8 key to get to the boot loader there you use the hit any key option to get to the command line to type in and then hit enter key
-v -f to boot in verbose mode forcing the reload/caching of the .kext on the system so the changes are seen.
2. Then your going to want to search on
kext_for_JMicron_ATA.zip site:insanelymac.com in Google to hopefully solve the issue with IDE devices and 4gb of ram in machine if this is what is going on.