Have you ever done anything like this?
Yes. During the design of Krang's element system I opted for a system based on Perl modules rather than rows in the database, which is how Bricolage did things. The result has been a huge increase in the power and flexibility of the system. It's possible to do just about anything with an element now. Better yet, through the magic of inheritence element systems can be reused and specialized for different uses.
However, there has been a cost: only Perl programmers can do element development in Krang. In Bricolage a suitably educated user can at least sketch out new elements.
-sam