Do the damn thing from the scratch and do it right,
then replace the old steaming pile of junk with it
This reminds me of the many attempts to rewrite nethack in a higher level language, like ruby or python.They all fail miserably, leaving nothing but a smoking crater and piles of code that is never to be used.
Turns out all those millions of lines of c code written over a period of 25 years actually do quite a lot.