Finding installed spyware

I am hoping someone can help me with a security issue on some Apple devices.
Let me apologize now for the long winded post.
I am trying to help a woman who is preparing to leave her psychotic stalker husband. Between her and her children they have a number of apple devices including iPhones, iPods, and Apple laptops. She cant afford to replace the devices so leaving them behind is a last resort.
THE PROBLEM: The soon to be Ex-husband has a strong background in computers, computer security and Apple devices. Given his previous history of stalking etc. and that he has had access to the devices, it seems likely he would have installed tracking software and/or spy software. My background has been in Windows, so am pretty clueless with Apple.
WHAT I NEED TO KNOW: Is there a way to identify and remove any and all tracking and spy software? I have been told the iPhone and iPad have tracking software natively installed so might need to be sent back to apple to be fixed? With laptop, can you do a factory restore like you can with Windows? Will we need disks or is it on a hard dive partition? And will that even help, or can it be like Computrace where the tracking is in the BIOS?
I know this is a lot of questions to ask but this is not the sort of thing I am likely to find with a Google search, and the cost if I get it wrong could be extremely high for her. Any help advice you can give would be greatly appreciated.

If it's a computer, chances that a tracking software is installed on the computer exist, but the computer will need to have access to internet in order to upload location to whoever need it. And there is noway to tell where could that spyware be in the MacBook since an application can be place pretty much anywhere in the Mac (not only in the application folder). But if the app is meant to run at boot up, check under up your username in "system preference> users and group> then click on the tab of Login item. I do not mean here to says that everything that gets load at start up will be shown there, but some show up there anyway.
Another way to clear all doubts is to format the hard drive and reinstall the OSX taking into consideration that restoring from a backup after clean installation can load back the tracking software if any was present in the OS when performing the backup.
Talking about ios now which is the operating system found in iPhone iPad iPod etc... He can't install any tracking apps on the iPhone without the iPhone being jailbreak, so if it's a stock ios, there is nothing to worry about, using iFunbox etc on a stock ios can allow installation of certain applications, but not the one that will run automatically in the background without asking permission to the user. In both cases, if you are uncertain, and want to set up your mind free, you can perform a factory restore which will bring the iDevice into a factory state.
Apps that track locations on ios are find my friends and find my phone. You can chose to reset those settings if you want.
As for a tracking hardware connected to the CPU or something likes that, it's also possible to achieve with today's technologies, only one way to figure it out will be to open the device and double check if there is nothing strange connected to the battery and floating somewhere there. I do not recommend this as it could result of void of warranty in case your device is still under warranty and if eventually there was nothing placed inside. Also you can easily break things inside if you don't know how to open and operate on them.
All and all, anyone wanting to track me be my guess, I not a fugitive, has nothing to fear from anyone, not doing anything illegal, so I would live with those device without worrying about any tracking things since I have no concrete proof that there is one except that the guy is an Apple Savy. Good luck.