Hey there!
I'm sorry that this has been happening. I can understand the concern for why you'd like them to stop, and how you can stop them from being able to access information like who you've been texting, and being able to see who you've called. Rest assured, I'll try my best to provide you the best information I have, and the best resources I'd recommend so you can start your using your iPhone with confidence without stressing about your privacy.
From what it does sound like, it sounds like the person who's doing this probably has access to your Apple ID. I'd definitely start their for the first step, by changing the password of your Apple ID. This was also suggested previously by two other Members on here. As you did mention that you did factory reset your iPhone, but they were still able to access some information off of your iPhone.
Hmm, just to note - you did mention that they were able to access your accounts. Are you referring to them being able to access multiple accounts of yours? Like your account for Snapchat, Twitter, Instagram, and so forth? If that's the case, you may want to change the passwords for each account, so they all have different passwords.
As far as any apps being able to remove Malware, there aren't any that I am aware of. I can understand your concern for wanting to keep your iPhone safe, and secure from malware. Personally, and what most of us on the Communities here would agree with is that taking some small steps like keeping your iPhone updated, and being cautious of the websites you visit, and only installing apps from trusted sources like the App Store are great ways to keep your iPhone secure from malware. As simple as it sounds, that's all you really have to do. Apple has designed their hardware and software to work harmoniously with each other to help keep your device secure.
In fact, here's a statement from Apple on the security of iOS:
"For starters, hardware and firmware features are designed to protect against malware and viruses, while iOS features help to secure your personal information. Touch ID lets you use your fingerprint as an easy alternative to entering your passcode each time, preventing unauthorized access to your device. And we give developers tools to make the safest apps possible, including top-notch encryption, app transport security, and more. The point is, security runs throughout the entire system — everything from the hardware to iOS to the App Store."
I hope this helps you!
😀