John: what you're talking about is feasible but highly complex. After all, a
number of talented ArsDigita engineers spent many months doing what you're
describing.
Note that since we built query files in XML, it's also feasible to rewrite the
query dispatcher in another language - in fact that was the whole point of
using XML instead of Tcl formatting!
Finally, since I am the picky license person around here, I want to remind you
that all of this stuff is covered under the GPL: if you redistribute work based in
a significant way on OpenACS (data model, logic, and templates), you need
to do so under the terms of the GPL. If you do not redistribute (if you're doing
this for just one client or for yourself), then you're free to do what you'd like.