I'm reading that differently to how I first did... In any case I've never seen such a file, and wouldn't recommend a quick fix using the class on the current version since you don't know what's being done to it before hand so problems will pop up(e.g. mres, and then the query() doing mres again...). Maybe changing over to something like NWE has to allow it to check what's being passed through, however that wouldn't fix the major issues left in the current source.
Not hard to do, but sure is time consuming. If you're doing it this way why would yours (or who ever the file is from...) be better then the others out there? Your original post sold it as a simple replacement... that is not longer what you're saying.