Hi,
I am a data analyst working in one of the top Indian MNCs. For financial firms, we face similar problems (building your own model without using any library). I have experience in building them in C++.
However, with other clients, I'm wrangling and modeling in Python and have full command over the language. So, it would be a cake-walk to re-write Naive Bayes for you. If you are interested, ping me.
Looking forward to hearing from you soon.
Regards,
Pratyay Roy