Random Textpatten Thought

Just a thought, but does anyone have any idea how difficult would it be to refactor textpattern’s publish.php into a class? I ask, because it would open all sorts of possibilities for customising many TXP without making major additions to the core. You could (in theory) then use class inheritance to redefine some of the important base functions like preText(). Heck, if we could refactor all of TXP into classes… Or maybe I’m just being silly.